Learn how to code this anomaly-detection algorithm

Read Romeo’s cognitive IoT tutorial that uses moving z-score

### In this video:

- Romeo Kienzler, Chief Data Scientist, IBM

Romeo’s algorithm locates outlying values in a time series of voltage data values.

He first generates some test data, into which he introduces some outlying values, which the application will locate. Because the z-score for any given observation is based on the mean and standard deviation of the last time window, he then calculates those values in the live data stream. Each observed voltage value is subtracted from the mean, then divided by the standard deviation. If the z-score is less than -0.5, an alert is sent.

In the example below, the voltage has shot up to more than 260 volts, causing the z-score to drop to below -0.5, resulting in an alert.

### Discovering Data Science with Romeo Kienzler

Follow Romeo as he tackles the most difficult challenges in data science.