Loading…
Glossary term
A change over time in the data a model sees, which can reduce its accuracy.
Data drift occurs when the inputs a deployed model sees change from those it was trained on: new customer behavior, a new camera, seasonal shifts. The model's accuracy can quietly decline.
It is detected by comparing statistics of live data with the training data.
Test whether a feature has drifted
from scipy.stats import ks_2samp
stat, p_value = ks_2samp(train_feature, live_feature)
if p_value < 0.01:
print("Distribution has shifted: investigate")Models do not stay good by themselves, so monitoring for drift is a core part of running AI in production.