DriftDetectionMetrics#
- class capymoa.drift.eval_detector.DriftDetectionMetrics[source]#
Bases:
objectMetrics for evaluating drift detection performance.
- __init__(
- fp: int,
- tp: int,
- fn: int,
- precision: float,
- recall: float,
- episode_recall: float,
- f1: float,
- mdt: float,
- ndt: float,
- far: float,
- ar: float,
- n_episodes: int,
- n_alarms: int,
- ar: float#
Alarm rate per
EvaluateDriftDetector.rate_periodinstances
- episode_recall: float#
Recall score for drift episodes (in this case, a correct prediction of a drift episode is counted as 1 true positive).
- far: float#
False alarm rate per
EvaluateDriftDetector.rate_periodinstances
- ndt: float#
mdtdivided byEvaluateDriftDetector.max_delay, so that detection delay is expressed as a fraction of the delay that was deemed acceptable.For abrupt drifts this runs from 0 (detected the instant the drift began) to 1 (detected just as the drift became obvious anyway). It can fall outside that range in two cases: with gradual drifts, because the delay is measured from the drift start while detections stay valid until
end + max_delay; and withEvaluateDriftDetector.max_early_detectionabove zero, which admits detections before the drift and so negative delays.Unlike
mdt, which is a count of instances,ndtis comparable across streams that were evaluated with different values ofmax_delay.