# `DataDriftResult`

### *class* capymoa.drift.detectors.DataDriftResult[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/drift/detectors/data_drift/base.py#L60)

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#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()`](capymoa.drift.detectors.BaseDataDriftDetector.md#capymoa.drift.detectors.BaseDataDriftDetector._test)).

#### \_\_init_\_(is_drift: [bool](https://docs.python.org/3/builtins/functions.html#bool), statistic: [float](https://docs.python.org/3/builtins/functions.html#float), p_value: [float](https://docs.python.org/3/builtins/functions.html#float) | [None](https://docs.python.org/3/builtins/constants.html#None) = None, distance: [float](https://docs.python.org/3/builtins/functions.html#float) | [None](https://docs.python.org/3/builtins/constants.html#None) = None, feature_statistics: [dict](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [float](https://docs.python.org/3/builtins/functions.html#float)] | [None](https://docs.python.org/3/builtins/constants.html#None) = None, feature_p_values: [dict](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [float](https://docs.python.org/3/builtins/functions.html#float)] | [None](https://docs.python.org/3/builtins/constants.html#None) = None, feature_is_drift: [dict](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [bool](https://docs.python.org/3/builtins/functions.html#bool)] | [None](https://docs.python.org/3/builtins/constants.html#None) = None) → [None](https://docs.python.org/3/builtins/constants.html#None)

#### distance *: [float](https://docs.python.org/3/builtins/functions.html#float) | [None](https://docs.python.org/3/builtins/constants.html#None)* *= None*

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

#### feature_is_drift *: [dict](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [bool](https://docs.python.org/3/builtins/functions.html#bool)] | [None](https://docs.python.org/3/builtins/constants.html#None)* *= None*

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

#### feature_p_values *: [dict](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [float](https://docs.python.org/3/builtins/functions.html#float)] | [None](https://docs.python.org/3/builtins/constants.html#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](https://docs.python.org/3/builtins/stdtypes.html#dict)[[Hashable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable), [float](https://docs.python.org/3/builtins/functions.html#float)] | [None](https://docs.python.org/3/builtins/constants.html#None)* *= None*

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

#### is_drift *: [bool](https://docs.python.org/3/builtins/functions.html#bool)*

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

#### p_value *: [float](https://docs.python.org/3/builtins/functions.html#float) | [None](https://docs.python.org/3/builtins/constants.html#None)* *= None*

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

#### statistic *: [float](https://docs.python.org/3/builtins/functions.html#float)*

Aggregate test statistic (max across features for univariate).
