CalcBoundsIQR

class CalcBoundsIQR[source]

Functor to set outlier bounds a fixed ratio above/below interquartile range.

Bounds are calculated as (q1 - iqr_multiplier * iqr, q3 + iqr_multiplier * iqr), where q1 and q3 are the first and third quartiles, respectively, and iqr is the interquartile range (q3 - q1).

__init__(iqr_multiplier: float = 1.5) None[source]

Initialize functor.

Parameters:

iqr_multiplier (float, default 1.5) – The multiplier applied to the IQR to determine the bounds.

Methods

__init__(iqr_multiplier: float = 1.5) None[source]

Initialize functor.

Parameters:

iqr_multiplier (float, default 1.5) – The multiplier applied to the IQR to determine the bounds.

__call__(data: Sequence[float]) Tuple[float, float][source]

Calculate the lower and upper bounds of the input data using the IQR method.

Parameters:

data (np.ndarray) – The input data for which the bounds are calculated.

Returns:

bounds – Lower and upper calculated bounds.

Return type:

Tuple[float, float]