BayesNetFragment.evEq

BayesNetFragment.evEq(name, value)

This method is used to set an observation on a quasi-continuous variables (pyagrum.DiscretizedVariable with a large number of ticks) that the variable is equal to a given value.

Notes

  • see also Tensor.evEq

  • see also BayesNet.evGt, BayesNet.evLt, BayesNet.evIn

Parameters:
  • var (int | str) – the current name or the id of the variable

  • value (float)

  • name (str)

Returns:

The representation of the evidence as a pyagrum.Tensor.

Return type:

pyagrum.Tensor

Example

import pyagrum as gum

bn = gum.fastBN("A[0:10:5]->B")  # 5 intervals from 0 to 10
fragment = gum.BayesNetFragment(bn)
fragment.installNode("A")
fragment.evEq("A", 3).tolist()
# [0.0, 1.0, 0.0, 0.0, 0.0]

Class

BayesNetFragment