Model Monitoring and Drift Detection
A deployed model does not stay good forever. The world changes, and so does the data. This topic explains why models degrade and how to detect problems early before they hurt the business.
Why Models Degrade Over Time
A model learns from past data, but it works on future data. When customer behavior, markets, or systems change, the patterns the model learned may no longer hold. Its predictions slowly get worse.
Other causes include changes in data collection, broken data pipelines, new products, and seasonal effects. A small upstream change, such as a renamed column, can quietly break a model.
Because of this, deployment is not the end of the project. Monitoring is needed to catch problems quickly, since bad predictions can lead to bad decisions without anyone noticing.
Data Drift and Concept Drift
Data drift means the input data has changed compared to the training data. For example, the average age of new customers may shift. The model sees values it was not trained for.
Concept drift means the relationship between the inputs and the target has changed. For example, the same customer behavior may no longer lead to churn. The rules of the world have changed.
Both types harm performance, but they need different checks. Data drift can be spotted by comparing input distributions. Concept drift usually shows up as a drop in model accuracy once true results are known.
Monitoring Performance and Data Quality
Monitor three things. First, the model's performance, using metrics like accuracy or error, once real outcomes become available. Second, the input data, checking for missing values, new categories, and shifts in distribution. Third, system health, such as response time and errors.
Statistical tests like the Kolmogorov-Smirnov test, and measures like the Population Stability Index, can compare new data with training data. Libraries such as Evidently and WhyLabs make this easier.
from scipy.stats import ks_2samp
stat, p_value = ks_2samp(train["income"], live["income"])
print(p_value)A low p-value suggests the distributions differ. Always combine tests with charts and business knowledge to avoid false alarms.
Setting Up Alerts
Monitoring is only useful if someone notices the problems. Set thresholds for key metrics and send alerts when they are crossed. Alerts can go to email, Slack, or an incident tool.
Choose thresholds carefully. Too sensitive, and the team gets flooded with false alarms and starts to ignore them. Too loose, and real problems slip by.
Decide in advance what happens when an alert fires. Who investigates? When should the model be rolled back or retrained? A clear plan makes the response fast and calm.
Data Science Lifecycle Tutorial
Wesline Rinisha








