# 4.6. Implementing custom metrics in Evidently \[OPTIONAL]

{% embed url="<https://youtu.be/uEyoP-sPhyc?si=7hwr4LaJIeBZ-YLD>" %}

**Video 6**. [Implementing custom metrics in Evidently \[OPTIONAL, CODE PRACTICE\]](https://youtu.be/uEyoP-sPhyc?si=7hwr4LaJIeBZ-YLD), by Emeli Dral

This is an optional code practice video. It is useful when you already have experience using the Evidently Python library and are familiar with the existing Metrics and Tests. If you are new - check out the next module for an end-to-end example!

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

**Outline:**\
[00:00](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=0s) Introduction\
[00:37](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=37s) Imports\
[01:54](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=114s) Understanding the structure of Metrics and Tests\
[05:11](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=311s) Create a dummy custom metric\
[12:17](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=737s) Apply a dummy metric on toy data\
[14:00](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=840s) Create a more complicated metric: Mean by Category\
[26:25](https://www.youtube.com/watch?v=uEyoP-sPhyc\&t=1585s) Apply a new metric on toy data
