Is Your Model Getting Lost? How to Catch Drift Before It Goes Rogue!

Ajay Gurav
4 min readOct 19, 2024

Imagine your model as a GPS — guiding you to the right destination. But one day, the roads have changed, and suddenly, it’s taking you into a lake instead of your favorite coffee shop. That’s drift in action, and it can totally mess up your ML model’s accuracy if you’re not paying attention!

Let’s dive into the coolest ways to capture and measure drift before your model gets lost in the wild!

1. Data Drift: When the World Changes on You

Ever wondered why your once-sharp model starts behaving like it needs a pair of glasses? That’s data drift, and it happens when the statistical properties of your input data change over time.

How to Catch It:

  • KL Divergence: Think of it like a spot-the-difference game between old and new data distributions. If they start diverging, KL Divergence raises a red flag.
  • Population Stability Index (PSI): This metric is like checking your pulse. It compares the distribution of your data now versus when the model was trained. Big difference? Big problem.

Real-World Example:

Imagine you’ve got a retail model predicting how many holiday sweaters people will buy in October. If the temperature suddenly goes tropical, people might start buying swimsuits instead — your input data (weather and buying behavior) has drifted. Time to adjust!

--

--