DiscreteVariable.isEmpirical

DiscreteVariable.isEmpirical()

Returns whether the variable is empirical (if the variable is a pyagrum.DiscretizedVariable). I.e. whether its limits (max and min) are defined by data and accept any values below or above these limits, contrary to non-empirical discretized variables for which the limits are fixed and values outside of these limits are not accepted)

Raises:

NotImplementedError – If the variable is not a pyagrum.DiscretizedVariable

Return type:

bool

Returns:

bool

whether the variable is empirical

Example

import pyagrum as gum

gum.fastVariable("x[0:10:5]").isEmpirical()
# False
gum.fastVariable("x+[0:10:5]").isEmpirical()  # '+': bounds defined by data
# True

Used by

DiscreteVariable, IntegerVariable, LabelizedVariable, NumericalDiscreteVariable, RangeVariable

Inheritance diagram of pyagrum.DiscreteVariable, pyagrum.IntegerVariable, pyagrum.LabelizedVariable, pyagrum.NumericalDiscreteVariable, pyagrum.RangeVariable

Overridden in

DiscretizedVariable.isEmpirical