Solve the coursera ml class with python