Data Drift Detection: How the Population Stability Index (PSI) Works
Data drift is a change in the distribution of a model's input data over time, and the population stability index (PSI) is one of the most widely used ways to measure it: values below 0.1 indicate a stable feature, 0.1 to 0.25 moderate drift and above 0.25 a major shift. TensorTurn detects date columns on upload and computes PSI between the first and second chronological half of your dataset, so you know whether your own history has drifted before you trust a model trained on it.
What data drift is
A machine learning model learns patterns from a fixed snapshot of the past and is then asked to predict on data that keeps changing. When the incoming data no longer looks like the training data, performance degrades, often silently. Three kinds of change are worth separating:
- Covariate drift (feature drift): the distribution of inputs changes, for example average order value rises after a price change or a new customer segment arrives.
- Prior or label drift: the share of each outcome changes, for example the fraud rate doubles during a holiday season.
- Concept drift: the relationship between inputs and outcome changes, for example the same browsing behavior that used to signal purchase intent no longer does.
PSI and most distribution tests measure the first two. Concept drift can only be confirmed by comparing predictions to actual outcomes once labels arrive.
Why drift matters for deployed models
A model's validation score describes performance on data that resembles the training set. Drift breaks that assumption. A credit model trained before an interest-rate change, a demand model trained before a new store format or a churn model trained before a pricing overhaul can all keep returning confident predictions that are steadily wrong. Because the model does not error, nobody notices until a business metric moves. Measuring drift gives you an early, label-free warning to retrain, recalibrate or investigate.
The population stability index in plain words
PSI compares two distributions of the same variable: a reference (expected) distribution, usually the training data, and a current (actual) distribution. The steps are simple:
- Split the variable into bins, commonly 10 bins at the deciles of the reference data for numeric columns, or one bin per category for categorical columns.
- Compute the share of rows that falls into each bin in the reference data and in the current data.
- For each bin, multiply the difference in shares (current minus reference) by the natural log of their ratio (current divided by reference).
- Add up those terms across all bins. The total is the PSI.
Each term is always zero or positive, so PSI only grows as the distributions diverge, and bins where a large share of rows moved contribute the most. Empty bins would make the log undefined, so implementations add a tiny constant to every share. PSI is closely related to a symmetric form of the Kullback-Leibler divergence, which is why it behaves sensibly as a distance between distributions.
| PSI value | Interpretation | Typical action |
|---|---|---|
| Below 0.1 | Stable, no meaningful shift | No action needed |
| 0.1 to 0.25 | Moderate drift | Investigate the feature and monitor closely |
| Above 0.25 | Major drift | Find the cause; consider retraining or excluding the feature |
These thresholds are industry rules of thumb that originated in credit scoring, not statistical tests. Small samples produce noisy PSI values, and the number of bins changes the result, so compare PSI values computed the same way.
Temporal drift inside your training data
Drift is not only a production problem. If your dataset spans months or years, it may already contain drift. TensorTurn splits the data at the midpoint of the detected date range and computes PSI between the first and second chronological half for each feature. If important features drift between halves, two things follow. First, a random shuffled train/test split will overstate real-world performance, because the model is tested on rows from the same periods it trained on. Use a time-based split instead, training on older data and testing on newer. Second, the most recent data is the best guide to the future, so consider weighting it more or dropping a stale early period.
Other ways to detect drift
| Method | Column type | Notes |
|---|---|---|
| PSI | Numeric (binned) or categorical | Easy to explain, widely used thresholds |
| Kolmogorov-Smirnov test | Numeric | Gives a p-value; with large samples almost any tiny shift becomes significant |
| Chi-square test | Categorical | Tests whether category frequencies changed |
| Jensen-Shannon distance | Numeric or categorical | Symmetric and bounded between 0 and 1 |
| Wasserstein distance | Numeric | Measured in the units of the feature, intuitive for magnitude of shift |
Common drift mistakes
- Alerting on statistical significance alone. With millions of rows, a KS test flags trivial shifts; use an effect-size measure such as PSI as well.
- Monitoring every feature equally. Prioritize the features the model relies on most.
- Confusing seasonality with drift. Compare against the same season of the reference period where relevant.
- Retraining blindly. If drift comes from a broken upstream pipeline, retraining teaches the model the bug.
How to check drift on TensorTurn
- Upload a dataset that includes a date or timestamp column; TensorTurn detects it automatically.
- Open the datetime analysis to see the time range, row volume over time and PSI per feature between the first and second half.
- Treat features above 0.25 as a warning: inspect their histograms and decide whether to keep, transform or drop them.
- When you describe the model in chat, ask for a time-based train/test split so the evaluation reflects future data.
- To check whether newer data has drifted, upload a dataset that spans both the training period and the new period so the chronological comparison covers both.
Note that TensorTurn measures drift in the data you upload; it does not run continuous drift monitoring on live prediction traffic. Deployed endpoints log every call with latency and status.
Frequently asked questions
What is the population stability index?
PSI is a measure of how much a variable's distribution has shifted between a reference dataset and a current one. It bins the variable, compares the share of rows in each bin and sums the difference in shares multiplied by the log of their ratio.
What is a good PSI value?
Below 0.1 is generally considered stable, 0.1 to 0.25 indicates moderate drift worth investigating and above 0.25 indicates a major shift. These are rules of thumb from credit risk modeling rather than formal significance tests.
What is the difference between data drift and concept drift?
Data drift is a change in the input distribution, which you can measure without labels. Concept drift is a change in the relationship between inputs and the target, which you can only confirm by comparing predictions with actual outcomes.
How do I detect drift without labels?
Compare the distribution of each input feature in new data against the training data using PSI, a KS test, Jensen-Shannon distance or similar measures. Large shifts in important features are an early warning even before outcomes are known.
Does TensorTurn monitor drift on deployed models?
No. TensorTurn measures temporal drift with PSI inside the datasets you upload, between the first and second chronological half. Deployed endpoints log calls with latency and status, but continuous production drift monitoring is not a feature.