For assignment 1 of the Coursera Practical Machine Learning course