xv in and explain the ideas behind broad class of regression models thereinwe also describe how python' statsmodels package can be used to define and analyze linear models builds upon the previous regression by developing the powerful concepts of kernel methods and regularizationwhich allow the fundamental ideas of to be expanded in an elegant wayusing the theory of reproducing kernel hilbert spaces in we proceed with the classification taskwhich also belongs to the supervised learning frameworkand consider various methods for classificationincluding bayes classificationlinear and quadratic discriminant analysisk-nearest neighborsand support vector machines in we consider versatile methods for regression and classification that make use of tree structures finallyin we consider the workings of neural networks and deep learningand show that these learning algorithms have simple mathematical interpretation an extensive range of exercises is provided at the end of each python code and data sets for each can be downloaded from the github siteacknowledgments some of the python code for and was adapted from [ we thank benoit liquet for making this availableand lauren jones for translating the code into python we thank all who through their commentsfeedbackand suggestions have contributed to this bookincluding qibin duanluke taylorremi mouzayekharry goodmanbryce stansfieldryan tongsdillon steylbill ruddnan yechristian hirschchris van der heidesarat mokaaapeli vuorinenjoshua rossgiang nguyenand the anonymous referees david grubbs deserves special accollade for his professionalism and attention to detail in his role as editor for this book the book was test-run during the summer school of the australian mathematical sciences institute more than bright upper-undergraduate (honoursstudents used the book for the course mathematical methods for machine learningtaught by zdravko botev we are grateful for the valuable feedback that they provided our special thanks go out to robert salomoneliam berryrobin carrickand sam daleywho commented in great detail on earlier versions of the entire book and wrote and improved our python code their enthusiasmperceptivenessand kind assistance have been invaluable of coursenone of this work would have been possible without the loving supportpatienceand encouragement from our familiesand we thank them with all our hearts this book was financially supported by the australian research council centre of excellence for mathematical statistical frontiersunder grant number ce dirk kroesezdravko botevthomas taimreand radislav vaisman brisbane and sydney