mvtsa.mlops.DriftMonitor#

class mvtsa.mlops.DriftMonitor(n_components=0.9, alpha=0.01, similarity_threshold=0.8, factor=5.0, segmenter=None)[source]#

Bases: object

Batch-wise drift monitoring against reference data.

For every new batch it reports

  • the fraction of samples beyond the \(T^2\) and \(Q\) control limits of the reference PCA model (expected: alpha);

  • the Krzanowski similarity of the batch PCA model to the reference model;

  • the largest per-variable Kolmogorov–Smirnov statistic and PSI;

  • optionally the KS statistic of the segment durations of a segmenter.

An alert is raised when an exceedance rate is more than factor times alpha, the similarity is below similarity_threshold, or a PSI exceeds 0.25.

Parameters:
n_componentsint or float
alphafloat
similarity_thresholdfloat
factorfloat
segmentersegmenter, optional
report()[source]#

History of the batch reports as a pandas DataFrame.

Examples using mvtsa.mlops.DriftMonitor#

Monitoring a deployed model for drift

Monitoring a deployed model for drift