DataDriftResult#

class capymoa.drift.detectors.DataDriftResult[source]#

Bases: object

Result returned by a data-drift comparison.

Every comparison produces a statistic. Statistical-test detectors also set p_value; distance-based detectors leave it as None and may set distance instead.

For univariate tests on multivariate data, feature_statistics, feature_p_values, and feature_is_drift map feature index to that feature’s value. The top-level statistic and p_value are aggregates (max statistic, min p-value). is_drift is the overall decision: for tests that produce p-values, after multiple-testing correction; for distance-based tests (no p-value), the per-feature decisions are combined without correction (see BaseDataDriftDetector._test()).

__init__(
is_drift: bool,
statistic: float,
p_value: float | None = None,
distance: float | None = None,
feature_statistics: dict[Hashable, float] | None = None,
feature_p_values: dict[Hashable, float] | None = None,
feature_is_drift: dict[Hashable, bool] | None = None,
) → None#
distance: float | None = None#

Distance metric, if applicable (e.g. MMD, EMD).

feature_is_drift: dict[Hashable, bool] | None = None#

Per-feature drift flags. Keys are feature names when available, otherwise integer indices. None for multivariate tests.

feature_p_values: dict[Hashable, float] | None = None#

Per-feature p-values. Keys are feature names when available, otherwise integer indices. None when the test has no p-value or for multivariate tests.

feature_statistics: dict[Hashable, float] | None = None#

Per-feature statistics. Keys are feature names when available, otherwise integer indices. None for multivariate tests.

is_drift: bool#

Overall drift decision (any feature). After correction for p-value tests; uncorrected for distance-based tests without p-values.

p_value: float | None = None#

Aggregate p-value (min across features for univariate).

statistic: float#

Aggregate test statistic (max across features for univariate).