EDDM<T>

Models & Types · AiDotNet.DriftDetection

Implements EDDM (Early Drift Detection Method) for concept drift detection.

Inheritance: DriftDetectorBase<T> → EDDM<T>

For Beginners

EDDM is an improvement over DDM that focuses on detecting drift earlier, especially for gradual drift. Instead of monitoring just the error rate, EDDM monitors the distance (number of samples) between consecutive errors.

How It Works

How EDDM works:

  • Track the distance between consecutive errors (not just error rate)
  • Maintain running mean (p’) and standard deviation (s’) of these distances
  • Monitor the ratio: current (p’ + 2s’) / maximum (p’ + 2s’)
  • Warning: ratio drops below warning threshold (e.g., 0.95)
  • Drift: ratio drops below drift threshold (e.g., 0.90)

Why distance between errors? When a model starts degrading:

  • Errors become more frequent → distances decrease
  • Error pattern becomes more consistent → standard deviation decreases
  • Both effects contribute to earlier detection than pure error rate

Advantages over DDM:

  • Earlier detection of gradual drift
  • More stable in presence of noise
  • Works well when errors are relatively rare

Reference: Baena-García et al., “Early Drift Detection Method” (2006)

Constructors

Constructor Summary
EDDM(double warningThreshold, double driftThreshold, int minimumObservations, int minimumErrors) Creates a new EDDM drift detector.

Properties

Property Summary
double DriftThreshold { get; } Gets the drift threshold (ratio of current to maximum p’ + 2s’).
double WarningThreshold { get; } Gets the warning threshold (ratio of current to maximum p’ + 2s’).
int ErrorCount { get; } Gets the total number of errors observed.
int MinimumErrors { get; } Gets the minimum number of errors required before detection starts.

Methods

Method Summary
bool AddObservation(T value) Adds a new observation (error indicator) to the detector.
double GetCurrentRatio() Gets the current ratio of performance to maximum observed.
double GetDistanceStd() Gets the current standard deviation of distances between errors.
double GetMeanDistance() Gets the current mean distance between errors.
void Reset()