BayesNetFragment.evEq
- BayesNetFragment.evEq(name, value)
This method is used to set an observation on a quasi-continuous variables (
pyagrum.DiscretizedVariablewith 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 variablevalue (
float)name (
str)
- Returns:
The representation of the evidence as a
pyagrum.Tensor.- Return type:
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