code for Ag's machine learning assignment