code for Coursera Practical Machine Learning report