BayesNet.evIn

BayesNet.evIn(name, val1, val2)

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 in a given range.

Notes

  • see also Tensor.evIn

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

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

  • valueMin (float) – the minimum value

  • valueMax (float) – the maximum value

  • name (str)

  • val1 (float)

  • val2 (float)

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]")  # 5 intervals from 0 to 10
bn.evIn("A", 3, 7).tolist()
# [0.0, 1.0, 1.0, 1.0, 0.0]

Class

BayesNet