Monitoring Machine Learning Models

Dmitry Kovalenkov25 May 2024

Problem

A data provider keeps hundreds of scoring models in production for many clients and handles tens of millions of requests per day. It owes clients stable score quality, but it never sees the outcome. For default models the target (90+ days overdue within 12 months) matures a year later, and the company usually lacks it. Degradation cannot be assessed quickly. Models are probabilistic (a score from 0 to 1) or categorical (an integer), and each client has its own traffic pattern.

Example from the article: in February one model's score distribution jumped. Its median score turned into a constant, and the cause was a client who had connected a vendor sending low-quality fraudulent traffic. Disconnecting that vendor normalized the stream.

Solution in brief

Monitor the stream of model responses instead of model quality. Once a day, compute PSI and simple score statistics from request logs, compare them with a base period taken from the model's first months online, and send an alert when PSI crosses a threshold. A per-model dashboard shows analysts where to look.

Questions this case answers
  • How to monitor hundreds of deployed scoring models for drift when the outcome arrives long after the prediction and is usually unavailable
  • How to tell a data or pipeline problem from a model problem using a daily stability index on the score distribution
  • How to monitor hundreds of scoring models when the target variable is not available
  • How to detect drift in a model's score stream with a daily Population Stability Index (PSI)

Tools and methods

  • Population Stability Index (PSI) — daily drift measure of the score distribution against a base period.
  • Score statistics — average, median, minimum, maximum and request count per day.
  • HDFS, PostgreSQL, Grafana — request logs, aggregated metrics and the dashboard.
  • Telegram and Mattermost — alert channels.
  • Docker, Kubernetes, git — the monitoring job runs as a production service.
Continue reading — it's free

Google or a one-time email code. No password.