mbdlyb.formalisms.bayesnet.io ============================= .. py:module:: mbdlyb.formalisms.bayesnet.io .. autoapi-nested-parse:: Input/Output utilities for Bayesian networks. This module provides functions to export Bayesian networks to standard formats: - BIF XML format for cross-platform compatibility - Netica format for use with the Netica software Functions: export_to_bifxml: Export a Bayesian network to BIF XML format. export_to_netica: Export a Bayesian network to Netica format. Functions --------- .. autoapisummary:: mbdlyb.formalisms.bayesnet.io.export_to_bifxml mbdlyb.formalisms.bayesnet.io.export_to_netica Module Contents --------------- .. py:function:: export_to_bifxml(net: mbdlyb.formalisms.bayesnet.base.BayesNet, path: Union[pathlib.Path, str], overwrite: bool = False) Export a Bayesian network to BIF XML format. Converts the abstract Bayesian network to pyAgrum format and saves it as a BIF (Bayesian Interchange Format) XML file. :param net: The BayesNet instance to export. :param path: The file path where the BIF XML file will be saved. If a string without an extension is provided, '.bifxml' is appended. :param overwrite: If False, raises FileExistsError if the file already exists. If True, overwrites existing files. Defaults to False. :raises FileExistsError: If the file exists and overwrite is False. .. py:function:: export_to_netica(net: mbdlyb.formalisms.bayesnet.base.BayesNet, path: Union[pathlib.Path, str], colormap: Optional[mbdlyb.colormap.ColorMap] = None, overwrite: bool = False) Export a Bayesian network to Netica format. Converts the abstract Bayesian network to Netica format (.dne file) suitable for use with the Netica software. Includes automatic node layout and optional color-coding of node types. :param net: The BayesNet instance to export. :param path: The file path where the Netica file will be saved. If a string without an extension is provided, '.dne' is appended. :param colormap: Optional ColorMap instance for coloring node types. If None, a default ColorMap is created. Defaults to None. :param overwrite: If False, raises FileExistsError if the file already exists. If True, overwrites existing files. Defaults to False. :raises FileExistsError: If the file exists and overwrite is False.