machine learning homework for https://class.coursera.org/ml-003