iqr_outliers_range#

iqr_outliers_range(data: ndarray, iqr_range: Tuple[int, int], scale: float, sharp_drop_ratio: float = 0.9) Tuple[float, float][source]#

Calculate outliers range on the data given using IQR.

Parameters
data: np.ndarray

Data to calculate outliers range for.

iqr_range: Tuple[int, int]

Two percentiles which define the IQR range

scale: float

The scale to multiply the IQR range for the outliers’ detection. When the percentiles values are the same (When many samples have the same value), the scale will be modified based on the closest element to the percentiles values and the sharp_drop_ratio parameter.

sharp_drop_ratio: float, default0.9

A threshold for the sharp drop outliers detection. When more than sharp_drop_ratio of the data contain the same value the rest will be considered as outliers. Also used to normalize the scale in case the percentiles values are the same.

Returns
——-
Tuple[float, float]

Tuple of lower limit and upper limit of outliers range