dataeval.utils.thresholds.ConstantThreshold¶
-
class dataeval.utils.thresholds.ConstantThreshold(lower=
None, upper=None)¶ A Threshold implementation that returns a constant lower and or upper threshold value.
- lower¶
The constant lower threshold value. Defaults to None, meaning there is no lower threshold.
- Type:¶
Optional[float]
- upper¶
The constant upper threshold value. Defaults to None, meaning there is no upper threshold.
- Type:¶
Optional[float]
- Raises:¶
ValueError – raised when an argument was given using an incorrect type or name:
ValueError – raised when the ConstantThreshold could not be created using the given argument values:
Examples
>>> data = np.array(range(10)) >>> t = ConstantThreshold(lower=None, upper=0.1) >>> t(data) (None, 0.1)- classmethod parse_object(obj)¶
Instantiate a
Thresholdsubclass from a dictionary.The dictionary must contain a
"type"key whose value matches a registeredthreshold_typestring (e.g."constant","standard_deviation","zscore"). The remaining key/value pairs are forwarded as keyword arguments to the matching subclass constructor.