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. None means no lower bound.

upper_multiplier : float or None

Override for the upper bound: Q3 + upper_multiplier * IQR. None means 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 Threshold subclass from a dictionary.

The dictionary must contain a "type" key whose value matches a registered threshold_type string (e.g. "constant", "standard_deviation", "zscore"). The remaining key/value pairs are forwarded as keyword arguments to the matching subclass constructor.

Parameters:
obj : dict[str, Any]

Dictionary representation of a threshold. The "type" key is popped from the dict during parsing.

Returns:

An instance of the matching Threshold subclass.

Return type:

Threshold

Raises:

ValueError – If "type" is missing or does not match any registered threshold subclass.