Skip to content

Comparison of Bayesian networks

tools for comparing Bayesian networks

To compare Bayesian network, one can compare the structure of the BNs (see pyagrum.lib.bn_vs_vb.GraphicalBNComparator). However BNs can also be compared as probability distributions.

Class representing exacte computation of divergence and distance between BNs

ExactBNdistance(P,Q) -> ExactBNdistance : Parameters: : - P (pyagrum.BayesNet) a Bayesian network - Q (pyagrum.BayesNet) another Bayesian network to compare with the first one

ExactBNdistance(ebnd) -> ExactBNdistance : Parameters: : - ebnd (pyagrum.ExactBNdistance) the exact BNdistance to copy

  • Returns: a dictionnary containing the different values after the computation.
  • Return type: Dict[str,float]

Class representing a Gibbs-Approximated computation of divergence and distance between BNs

GibbsBNdistance(P,Q) -> GibbsBNdistance : Parameters: : - P (pyagrum.BayesNet) – a Bayesian network - Q (pyagrum.BayesNet) – another Bayesian network to compare with the first one

GibbsBNdistance(gbnd) -> GibbsBNdistance : Parameters: : - gbnd (pyagrum.GibbsBNdistance) – the Gibbs BNdistance to copy

  • Returns: size of burn in on number of iteration
  • Return type: int
  • Returns: a dictionnary containing the different values after the computation.
  • Return type: Dict[str,float]

Continue the approximation scheme.

  • Parameters: error (float)
  • Return type: bool
  • Returns: get the current running time in second (float)
  • Return type: float

Disable epsilon as a stopping criterion.

  • Return type: None

Disable max iterations as a stopping criterion.

  • Return type: None

Disable max time as a stopping criterion.

  • Return type: None

Disable a min epsilon rate as a stopping criterion.

  • Return type: None

Enable epsilon as a stopping criterion.

  • Return type: None

Enable max iterations as a stopping criterion.

  • Return type: None

Enable max time as a stopping criterion.

  • Return type: None

Enable a min epsilon rate as a stopping criterion.

  • Return type: None
  • Returns: the value of epsilon
  • Return type: float
  • Returns: the scheme history
  • Return type: tuple
  • Raises: pyagrum.OperationNotAllowed – If the scheme did not performed or if verbosity is set to false

Initiate the approximation scheme.

  • Return type: None
  • Returns: True if variables are drawn at random
  • Return type: bool
  • Returns: True if epsilon is used as a stopping criterion.
  • Return type: bool
  • Returns: True if max iterations is used as a stopping criterion
  • Return type: bool
  • Returns: True if max time is used as a stopping criterion
  • Return type: bool
  • Returns: True if epsilon rate is used as a stopping criterion
  • Return type: bool
  • Returns: the criterion on number of iterations
  • Return type: int
  • Returns: the timeout(in seconds)
  • Return type: float
  • Returns: the approximation scheme message
  • Return type: str
  • Returns: the value of the minimal epsilon rate
  • Return type: float
  • Returns: the number of variable drawn at each iteration
  • Return type: int
  • Returns: the number of iterations
  • Return type: int
  • Returns: the number of samples between 2 stopping
  • Return type: int
  • Raises: pyagrum.OutOfBounds – If p<1
  • Returns: the number of remaining burn in
  • Return type: int
  • Parameters: b (int) – size of burn in on number of iteration
  • Return type: None
  • Parameters: _atRandom (bool) – indicates if variables should be drawn at random
  • Return type: None
  • Parameters: eps (float) – the epsilon we want to use
  • Raises: pyagrum.OutOfBounds – If eps<0
  • Return type: None
  • Parameters: max (int) – the maximum number of iteration
  • Raises: pyagrum.OutOfBounds – If max <= 1
  • Return type: None
  • Parameters:
    • tiemout (float) – stopping criterion on timeout (in seconds)
    • timeout (float)
  • Raises: pyagrum.OutOfBounds – If timeout<=0.0
  • Return type: None
  • Parameters: rate (float) – the minimal epsilon rate
  • Return type: None
  • Parameters: _nbr (int) – the number of variables to be drawn at each iteration
  • Return type: None
  • Parameters: p (int) – number of samples between 2 stopping
  • Raises: pyagrum.OutOfBounds – If p<1
  • Return type: None
  • Parameters: v (bool) – verbosity
  • Return type: None
  • Returns: True if it is a start of a period
  • Return type: bool
  • Returns: the state of the approximation scheme
  • Return type: int

Stop the approximation scheme.

  • Return type: None

Update the approximation scheme.

  • Parameters: incr (int)
  • Return type: None
  • Returns: True if the verbosity is enabled
  • Return type: bool