tutorial code for machine learning