BIFWriter#
- class pgmpy.readwrite.BIFWriter(model, round_values=None)[source]#
Bases:
objectInitialise a BIFWriter Object
- Parameters:
- model: DiscreteBayesianNetwork Instance
- round_values: int (default: None)
Round the probability values to round_values decimals. If None, keeps all decimal points.
Examples
>>> from pgmpy.readwrite import BIFWriter >>> from pgmpy.example_models import load_model >>> asia = load_model("bnlearn/asia") >>> writer = BIFWriter(asia) >>> writer <writer_BIF.BIFWriter at 0x7f05e5ea27b8> >>> writer.write("asia.bif")
- get_parents()[source]#
Add the parents to BIF
- Returns:
- dict: dict of type {variable: a list of parents}
- get_properties()[source]#
Add property to variables in BIF
- Returns:
- dict: dict of type {variable: list of properties }