保留正文与补采附件。源页面当前未重新核验;具体限制见交付清单。

Revisit consent button We value your privacy We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies. Customise Reject All Accept All Customise Consent Preferences We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below. The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more NecessaryAlways Active Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytics Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Uncategorised Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet. No cookies to display. Reject All Save My Preferences Accept All Toggle SearchToggle Mobile Navigation Publish AI, ML & data-science insights to a global community of data professionals. Sign inSubmit an Article LatestEditor's PicksNewsletterShipAI


Write For TDS LinkedInXToggle Search Artificial Intelligence

Data drift: It can come at you from anywhere

The concept of data drift is illustrated visually in various shapes and forms. Tirthajyoti Sarkar January 19, 20225 min read

A short introduction to data drift

Machine learning (ML) models, at least in their present incarnations, are little more than powerful inductive machines. Their lofty goal is to go from a small example set to a broader inductive generalization. Naturally, for successful (and dependable) functioning, they need to depend on the critical assumption - the input data distribution does not drift away too much over time. Because, if that happens, then a successful model is only successful at a single point in time. Over time, the model will make inductive generalizations based on a distribution that is not exactly what it was trained on, and performance will degrade. So, we need monitoring and (timely) detection of any data-drift in the MLOps or ModelOps pipeline for any (continually) successful ML model deployment. Apart from regular MLops, the concept of data drift is important for ML explainability or Explainable AI (xAI) field too. Where exactly a data drift monitoring block should sit in an end-to-end MLops cycle is nicely visualized in the following article.

Essential guide to Machine Learning Model Monitoring in Production A lot of articles on this topic discuss the shape and statistical properties of the input distributions. In this article, we will take the example of (one or more) data streams feeding into ML models in the form of time series and visualize those variations to understand the concept clearly. Additionally, we will also talk about a few not-so-obvious sources of data drifts in an industrial context. Learn this step by step with the interactive AI Engineer, AI and Data Scientist, Computer Science and Machine Learning roadmaps.

Data drift is like a box of chocolates...

You never know what you're gonna get (next)! Let's see some obvious and not-so-obvious examples...

Level shift? Obviously

This is an obvious data drift. In many unsupervised model settings, this will also be called an 'outlier ' or 'anomaly '. Also note, drift may not be permanent and can be short-lived. Both the start and end of the drift should be identified quickly.

Variance shift? Subtler

This is slightly harder to detect than level shift. See the illustration below.

Variance decrease? That's a drift too

At a high level, business/ process people (or your customer) will tell you that high variance is bad. Yes, they are almost always right. But from a data drift point of view, you have to watch for any chance - even a sudden decrease in the variance. Statistically, that is a change in the distribution properties too.

Peak shifts inside a period

This one is more subtle and hard to detect. I have tried to illustrate the drift with additional annotations like peak and period. Did you see what really happened here? The data comes in a periodic fashion and there is a peak within each period. The relative position of that peak (within a period) shifted for some time before it came back to normal. Do you see the problem? Simple statistical properties may not catch this drift. The mean and variance (other moments too) may look similar. How do you catch it then? Interestingly, some simple spectral analysis will indicate a shift. So, you have to bring in some knowledge of signal processing to catch this data drift.

Contextual data - another way to catch the drift

If you are also monitoring a logging stream that has fixed-time indicators, like a shift start, or a machine reset, that can sometimes help catch these temporal shifts in an intuitive manner. The data monitoring has to ensure excellent time-synchronization of course. In the following illustration, the anchor events and the relative distance of the peaks from those anchors will indicate a drift.

Phase-shift/delay

This is a killer, in a true sense. For ML models training and inferencing on time-series data, a slight phase delay can generate totally wrong predictions. Basically, the model was trained like "If _X_1 and _X_2 were similar then predict _Y_0, otherwise predict _Y_1". Now, look at the situation below and realize what would happen with out-of-phase data streams. The top data stream is fine, the bottom one drifted slightly. It is possible that the data stream is fine, only the acquisition was delayed and fell out of sync.

Some are drift, some not

In industrial or manufacturing scenarios, process recipes and settings change all the time. There may also be a scheduled changelog. This kind of contextual data needs to be monitored for identifying correct data drift. Here is the visual illustration,

Measurement/Sensor drift

This is also one of the hardest to detect and manage. The input data streams and the generative processes may be fine but there may be drift on the sensor (that is measuring the incoming data and feeding to the ML model or monitoring system). A monitoring system (consisting of an ML model and an alert generating module) may detect a drift and send a wrong recommendation signal to the core process layer thinking that the fundamental process has shifted. That would be a misjudgment and bad recommendation. This is also an example where a concept drift (the model or the physical dynamics of the sensor itself) can be mistaken for a data drift. That's an error to be avoided at all costs.

Summary

We discussed the concept of data drift in a time-series sense by showing some visual illustrations. It is obvious that catching and analyzing data drift is not a trivial problem, even in the simplest one-dimensional setting. Additional techniques like signal processing or merging with contextual data may be needed to correctly identify the onset and nature of data drift. What are the mitigations? There is no one answer and it totally depends on the industry and the specific application area. This article goes through some of them systematically. Give it a read.

"My data drifted. What's next?" How to handle ML model drift in production.


Loved the article? Become a Medium member to continue learning without limits . I'll receive a portion of your membership fee if you use the following link,__with no extra cost to you .

Join Medium with my referral link - Tirthajyoti Sarkar

Register Now to Continue Reading

Unlock Towards Data Science with a Free Account

All articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more. Register for freeSign in to your account


Written By

Tirthajyoti Sarkar

See all from Tirthajyoti Sarkar Artificial IntelligenceData ScienceMachine LearningTechnology Share This Article

Towards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program. Write for TDS

Related Articles

Object Detection Basics - A Comprehensive Beginner's Guide (Part 1)

Deep Learning Learn the basics of this advanced computer vision task of object detection in an easy to understand multi-part beginner's guide Raghav Bali February 5, 202410 min read

Solving Inverse Problems With Physics-Informed DeepONet: A Practical Guide With Code Implementation

Machine Learning Two case studies with parameter estimation and input function calibration Shuai Guo July 17, 202324 min read

TDS Newsletter: How to Build Robust Data and AI Systems

The Variable Gain a high-level understanding of how the different pieces in your workflow come together TDS Editors November 20, 20253 min read

AI Will Impact Computer-Based Jobs First-and Hard

Artificial Intelligence OpenAI's CEO made a prediction that could change everything. Alberto Romero June 18, 20215 min read

Carbon Footprint: Why Common Claims May Not Be Accurate

Data Science Creating robust CO₂ scenarios for data-driven climate action Boris Ruf March 31, 20237 min read

Neural Networks Backpropagation Made Easy

Deep Learning A friendly guide to the mathematical intuition behind vanilla Neural Networks. Understanding the mathematical operations... Lihi Gur Arie, PhD May 8, 20217 min read

Spectral Entropy - An Underestimated Time Series Feature

Machine Learning I show how spectral entropy helped me solve two time series classification problems. Ning Jia December 7, 20226 min read

What Makes A Strong AI?

Artificial Intelligence "The Book of Why" Chapters 9&10, a Read with Me series Zijing Zhu, PhD January 4, 202414 min read

Math Unsupervised

Data Science Throughout my many years in math education as a tutor, TA, and teacher, one thing that stood out to me was that my students consistently... Neda Saleem December 15, 20204 min read

Your home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals. Subscribe to Our NewsletterWrite For TDS•About•Advertise•Privacy Policy•Terms of Use © Insight Media Group, LLC 2026•The New Stack•roadmap.sh•Creator Network

Recommended Articles

Close