eqdisco.mlops.DriftMonitor#
- class eqdisco.mlops.DriftMonitor(equation, X_ref, y_ref=None, psi_warning=0.1, psi_retrain=0.25, domain_tolerance=0.05, ph_delta=0.1, ph_lambda=10.0, sample_size_correction=True)[source]#
Bases:
objectMonitor the inputs and residuals of a deployed equation.
- Parameters:
- equation
Equation - X_ref, y_refarray_like
Reference (training) data.
- psi_warning, psi_retrain
float PSI thresholds of a warning and of a retraining recommendation.
- sample_size_correctionbool, default=True
Raise each PSI threshold to the 95 % (warning) or 99 % (retraining) point of the PSI of two same-distribution samples of the actual sizes (
psi_critical_value()), so that small batches do not raise false alarms.- domain_tolerance
float Share of new samples allowed outside the training box before a warning.
- ph_delta, ph_lambda
float Page–Hinkley parameters, relative to the reference residual standard deviation: tolerated drift magnitude and detection threshold.
- equation
- check(X_new, y_new=None)[source]#
Drift report of a batch of new data.
Returns a dictionary with per-variable PSI and Kolmogorov–Smirnov p-values, the share of samples outside the training box, residual statistics and the Page–Hinkley alarm (if
y_newis given), andstatusin{"ok", "warning", "retrain"}with thereasons.