Skip to content

Detectors

RangeValueDetector

RangeValueDetector(
    min_val: float | int | datetime | str,
    max_val: float | int | datetime | str,
)

Detect values within a range.

Parameters:

Name Type Description Default
min_val float | int | datetime | str

The minimum value of the range.

required
max_val float | int | datetime | str

The maximum value of the range.

required

RareCategoryDetector

RareCategoryDetector(min_occurrences: int = 1)

Detect rare categories.

Parameters:

Name Type Description Default
min_occurrences int

The minimum number of occurrences for a category to avoid detection.

1

SpecialValuesDetector

SpecialValuesDetector(values: Sequence)

Detect specific given values.

Parameters:

Name Type Description Default
values Sequence

The sequence of values to be detected.

required

QuantileTailsDetector

QuantileTailsDetector(
    quantile: float = 0.005, side: str | Side = BOTH
)

Detect values in the tails of the data distribution.

Parameters:

Name Type Description Default
quantile float

The quantile defining the tails. Must be between 0 and 1.

0.005
side str | Side

The side of the distribution to consider. Should be a Side object or a string representing a Side.

BOTH

ThresholdCategoryDetector

ThresholdCategoryDetector(threshold: float = 0.99)

Detect the lowest frequency categories in order to avoid detection of a given minimal fraction of the total number of categories.

Parameters:

Name Type Description Default
threshold float

The minimal fraction of the total number of categories to avoid detection. Must be a float between 0 and 1.

0.99

DateTimeQuantileTailsDetector

DateTimeQuantileTailsDetector(
    quantile: float = 0.005,
    side: Side = BOTH,
    fmt: str | None = None,
)

Detect datetime values in the tails of the data distribution.

Parameters:

Name Type Description Default
quantile float

The quantile defining the tails. Must be between 0 and 1.

0.005
side Side

The side of the distribution to consider. Should be a Side object or a string representing a Side.

BOTH
fmt str | None

The datetime format. If None, it will be automatically inferred.

None

DateTimeRangeValueDetector

DateTimeRangeValueDetector(
    min_val: str | datetime,
    max_val: str | datetime,
    fmt: str | None = None,
)

Detect datetime values within a range.

Parameters:

Name Type Description Default
min_val str | datetime

The minimum value of the range.

required
max_val str | datetime

The maximum value of the range.

required
fmt str | None

The datetime format. If None, it will be automatically inferred.

None

TimeRangeValueDetector

TimeRangeValueDetector(
    min_val: str | datetime, max_val: str | datetime
)

Detect time values within a range.

Parameters:

Name Type Description Default
min_val str | datetime

The minimum value of the range.

required
max_val str | datetime

The maximum value of the range.

required

AggregateDetector

AggregateDetector(detectors: Sequence[Detector] = ())

List of detectors to be simultaneously applied to the data.

Parameters:

Name Type Description Default
detectors Sequence[Detector]

A sequence of Detector objects.

()