Navigate Select ESC Close

Anomaly detection in time series with Python | Data Science with Marco

2023-04-16 Science & Technology
62.4k
1.2k
40

Hands-on Anomaly Detection in Time Series Data using Python Methods

Learn three distinct Python methods—Robust Z-score, Isolation Forest, and Local Outlier Factor—to accurately identify rare, deviating events in your time series data.

Short Summary

  • Understand why anomaly detection is crucial for monitoring system health and ensuring stable forecasting models.
  • Implement a baseline Robust Z-score method tailored for non-normal data using the Median Absolute Deviation (MAD).
  • Evaluate tree-based (Isolation Forest) and density-based (LOF) algorithms, comparing their success rates on real AWS CPU utilization data.
  • The session moves between theoretical explanation and immediate code implementation in a Jupyter Notebook environment.

This lesson details the theoretical foundations and practical Python implementation for finding outliers in time series. Readers gain insight into method selection based on data characteristics, demonstrated by testing three techniques against labeled real-world CPU utilization metrics.

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

A hands-on lesson on detecting outliers in time series data using Python. Full source code: https://github.com/marcopeix/youtube_tutorials/blob/main/YT_02_anomaly_detection_time_series.ipynb Dataset can be found here: https://github.com/numenta/NAB/blob/master/data/realAWSCloudwatch/ec2_cpu_utilization_24ae8d.csv Labels can be found here: https://github.com/numenta/NAB/blob/master/labels/combined_labels.json Chapters: Introduction - 0:00 Get the data - 4:11 Robust Z-score method - 9:08 Robust Z-score method (code) - 13:12 Isolation forest - 20:48 Isolation forest (code) - 22:33 Local outlier factor - 27:16 Local outlier factor (code) - 31:21 Thank you - 34:01

Top Comments (10)

@EngMAli-vk3nz 2023-07-15

Thanks for this We Hope to make Some One For MultiVariate Time Series Anomaly Detection

7
@ab3180 2026-04-17

Nice

0
@shgo 2025-05-09

Really nice intro to the subject, Marco! Thanks for the tutorial! I'll definitely recommend that to my students.

0
@joaovict007 2024-03-07

Very interesting content, thank you!

0
@Fatimazahraelmhedden 2025-10-18

thank you very much . from Morocco

0
@littlepigywigy 2024-03-05

nice and clear

0
@Binsoyaxie 2026-04-15

Hello, i want to create an ai in an mobile android app that is on device learning or realtime learning, like the owner trains the ai in realtime like how the owner swipes, app usage, and app transistions, then after the ai is 100% trained, the ai is ready for possbible intruder in the phone How should I do this?

0
@PoulamiSenapati-u8x 2024-02-09

Hello Marco, thank you so much for such a great video. Can you please make a video on anomaly detection for time series data using pycaret.

0
@hoanhvong 2024-01-27

🎉 thank you a lot

0
@wisecarverrr 2025-04-25

Great video, thank you!

0

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot