Almost everyone who has trained a machine learning model has had this moment. The accuracy looks great, the charts look clean, and you feel pretty good about the whole thing. Then the model goes live and the results are just bad. Not slightly worse. Bad enough that people stop trusting it.
This isn't rare, and it usually isn't because the model itself is poor. The problem is the gap between the neat environment where models are trained and the messy one where they actually run. Here are the reasons we see most often.
Your test score might be lying to you
The most common culprit is data leakage. That means information from the answer slips into the data the model learns from, so it looks smart without really being smart.
A simple example: you build a model to predict which customers will cancel. One of your columns is "account closed date". Of course the model does well, because it can see the future. In real use that column is empty until the customer has already left, so the model has nothing to work with.
Leakage can be much quieter than that. Splitting data randomly when it should be split by time is a classic one. If you're predicting next month's sales, training on a random mix of past and future rows gives you a score that won't hold up. The fix is to test the way the model will really be used: train on the past, test on what came after.
The world changes, and the model doesn't
A model learns from a snapshot of the past. Customer habits change, prices change, new products appear, and sometimes a competitor changes everything overnight. The data coming in slowly stops looking like the data the model was trained on. This is usually called data drift.
The tricky part is that nothing crashes. The model keeps returning answers, they just get a little worse each week. Without anyone watching, you can go months before someone notices.
Training and production don't match
This one is more boring but causes a lot of damage. The code that prepares data for training is often written separately from the code that prepares data in the live app. A date gets formatted differently. Missing values are filled in one way during training and another way in production. A column gets renamed.
The model receives slightly different inputs than it learned from, and the output quietly suffers. Using the same preparation code in both places removes a whole category of these bugs.
You measured the wrong thing
Accuracy is easy to compute and easy to misread. Say only 2 percent of transactions are fraud. A model that calls everything "not fraud" is 98 percent accurate and completely useless.
Before building anything, it helps to ask what a wrong answer costs. Missing a fraud case and flagging a normal customer by mistake are very different problems, so a single accuracy number doesn't capture it. Precision, recall and the cost of each type of error usually tell you much more.
A model is only good if it helps the business decision it was built for. The metric is just a stand-in for that.
Nobody planned for after launch
A lot of projects treat deployment as the finish line. In practice it's closer to the starting line. Someone needs to own the model once it's live, and that includes checking whether it still works.
At a minimum, it's worth keeping an eye on:
- The inputs. Are values still in the range you'd expect, and are there more missing fields than before?
- The outputs. Has the mix of predictions shifted suddenly?
- The real outcomes, as soon as they're known, so you can compare them with what the model predicted.
- Plain old errors and slow responses, like any other part of your system.
You also want a plan for retraining, and a way to roll back to the previous version if a new one behaves badly.
Start simpler than you think you need to
It's tempting to reach for the most advanced model available. But a simple model that you understand, can explain, and can maintain often beats a complicated one that nobody dares to touch. A basic baseline is also useful for another reason. If your fancy model only beats it by a tiny margin, that's worth knowing before you spend months on it.
And sometimes the honest answer is that you don't need machine learning at all. A few clear rules can solve the problem faster and with fewer surprises.
A short checklist before you ship
- Check every input feature and ask whether you'd really have it at the moment of prediction.
- Split your data by time if time matters.
- Compare against a simple baseline.
- Choose a metric that reflects the real cost of mistakes.
- Use the same data preparation in training and production.
- Set up monitoring and decide who looks at it.
- Have a rollback plan.
None of this is glamorous, but it's usually what separates a demo that impresses people from a system they can depend on.
If you're working on an AI feature and want a second pair of eyes, take a look at our AI integration work or get a free quote. We're happy to talk it through.
