dataeval.utils.thresholds.IQRThreshold¶
-
class dataeval.utils.thresholds.IQRThreshold(multiplier=
1.5, *, lower_multiplier=_UNSET, upper_multiplier=_UNSET, lower_limit=None, upper_limit=None)¶ Threshold based on interquartile range.
Outliers are values outside
[Q1 - multiplier * IQR, Q3 + multiplier * IQR]. Supports asymmetric lower/upper multipliers.- Parameters:¶
- multiplier : float or None, default 1.5¶
Symmetric multiplier applied to both bounds. Overridden per-side by lower_multiplier / upper_multiplier when provided.
- lower_multiplier : float or None¶
Override for the lower bound:
Q1 - lower_multiplier * IQR.Nonemeans no lower bound.- upper_multiplier : float or None¶
Override for the upper bound:
Q3 + upper_multiplier * IQR.Nonemeans no upper bound.
Examples
>>> data = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]) >>> t = IQRThreshold(1.5) >>> lower, upper = t(data)- 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.