UAIWriter#
- class pgmpy.readwrite.UAIWriter(model, round_values=None)[source]#
Bases:
objectInitialize an instance of UAI writer class
- Parameters:
- model: A Bayesian or Markov model
The model to write
- round_values: int (default: None)
The number to decimals to which to round the probability values. If None, keeps all decimals points.
Examples
>>> from pgmpy.readwrite import UAIWriter >>> from pgmpy.example_models import load_model >>> model = load_model("bnlearn/asia") >>> writer = UAIWriter(asia) >>> writer.write("asia.uai")
- get_domain()[source]#
Adds domain of each variable to the network.
Examples
>>> from pgmpy.readwrite import UAIWriter >>> writer = UAIWriter(model) >>> writer.get_domain()
- get_functions()[source]#
Adds functions to the network.
Examples ——-_ >>> from pgmpy.readwrite import UAIWriter >>> writer = UAIWriter(model) >>> writer.get_functions()
- get_nodes()[source]#
Adds variables to the network.
Examples
>>> from pgmpy.readwrite import UAIWriter >>> writer = UAIWriter(model) >>> writer.get_nodes()
- get_tables()[source]#
Adds tables to the network.
Examples
>>> from pgmpy.readwrite import UAIWriter >>> writer = UAIWriter(model) >>> writer.get_tables()