Coding up machine learning algorithms described in "Elements of Statistical Learning"