> For the complete documentation index, see [llms.txt](https://learn.evidentlyai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.evidentlyai.com/ml-observability-course/module-2-ml-monitoring-metrics/data-prediction-drift-code-practice.md).

# 2.8. Data and prediction drift in ML \[CODE PRACTICE]

{% embed url="<https://www.youtube.com/watch?v=oO1K4CaWxt0&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF&index=14>" %}

**Video 8**. [Data and prediction drift in ML \[CODE PRACTICE\]](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14), by Emeli Dral

In this video, we walk you through the code example of detecting data drift and creating a custom method for drift detection using the open-source [Evidently](https://github.com/evidentlyai/evidently) Python library.

**Want to go straight to code?** Here is the [example notebook](https://github.com/evidentlyai/ml_observability_course/blob/main/module2/data_drift_deep_dive.ipynb) to follow along.

**Outline**:\
[00:00](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=0s) Create a working environment and import libraries\
[01:33](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=93s) Overview of the data drift options\
[04:25](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=265s) Evaluating share of drifted features\
[06:40](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=400s) Detecting column drift\
[11:47](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=707s) Set different drift detection method per feature type\
[12:57](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=777s) Set individual different drift detection methods per feature\
[15:34](https://www.youtube.com/watch?v=oO1K4CaWxt0\&list=PL9omX6impEuOpTezeRF-M04BW3VfnPBRF\&index=14\&t=934s) Custom drift detection method

## Enjoyed the content?

Star Evidently on GitHub to contribute back! This helps us create free, open-source tools and content for the community.

⭐️ [Star](https://github.com/evidentlyai/evidently) on GitHub!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.evidentlyai.com/ml-observability-course/module-2-ml-monitoring-metrics/data-prediction-drift-code-practice.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
