Machine Learning HW #3 solution