Skip to content
Code for machine learning workshop given to Sanger Systems group
Branch: master
Clone or download

Latest commit


Type Name Latest commit message Commit time
Failed to load latest commit information.
images Add graphs Jun 30, 2015
Unsupervised Learning.ipynb

Sanger Anomaly Detection Workshop Code

This repository contains code used for the unsupervised learning section of the machine learning workshop given to the Systems group at Sanger.

The idea is based on Chapter 4, More Complex, Adaptive Models from Practical Machine Learning by Ted Dunning and Ellen Friedman.

Update: Majid al-Dosari (in the comments at and Eamonn Keogh point out that there may be issues with the approach described here for the reasons outlined in Clustering of Time Series Subsequences is Meaningless. This material still serves as an introduction to unsupervised learning and clustering, but beware in using it for anomaly detection in practice.


  • Unsupervised Learning.ipynb is an IPython notebook demonstrating a simple example of unsupervised learning: time-series anomaly detection. View a static version of the notebook at
  • a02.dat is a set of EKG data from PhysioNet used to demonstrate the algorithms.
  • is a module for reading the EKG data.
  • is a collection of helper functions developed in the notebook, saved as a module for reuse.
  • is a complete listing for the code developed in the notebook.


Python is required, along with the following modules:

  • NumPy
  • matplotlib
  • scikit-learn

IPython Notebook dependencies are also required, if running the notebook.

If you're on Ubuntu:

$ sudo apt-get install ipython-notebook python-numpy python-matplotlib python-sklearn

Or on any system with pip:

$ pip install ipython[notebook] numpy matplotlib scikit-learn
You can’t perform that action at this time.