BayesNet.saveUAI

BayesNet.saveUAI(*args)

Save the BayesNet in an UAI file.

Parameters:
  • name (str) – the file’s name

  • allowModificationWhenSaving (bool) – by default, pyagrum.config['core','allowModificationWhenSaving'] (False unless configured). if true, syntax errors are corrected when saving the file. If false, they throw a FatalError.

Return type:

None

Example

import pyagrum as gum

bn = gum.fastBN("A->B[3]->C")
bn.saveUAI("model.uai")
open("model.uai").readline().strip()  # the type of the model
# 'BAYES'
bn2 = gum.loadBN("model.uai")
bn2.dim() == bn.dim()
# True

Class

BayesNet