Module 5: Machine Learning Basics

Topic 2: Training ML

How do we train an ML model?

With the previous version of the book and when the class was fully in-person, I would discuss training after we do some specific example ML models.  The new version of the book has this before the other methods we are doing in this module so I’m going to have you read about it here.  If it feels out of order or feels too general (e.g. you need some methods to make it more concrete), feel free to go glance at the next module (that is where we start methods) and then come back to this topic.  The goal of what we will discuss in this topic is how you should train machine learning models, how to evaluate performance, and how to recognize overfitting and to hopefully stop it from happening.

Reading assignment: Read Section 19.4 (yes, we skipped 19.3, that will be the focus of the next module!  This one is on Model Selection and Optimization)

Training data, Validation data, and Test data 

All ML methods (again, we will get to methods in the next module) require data to train.  This is different than our search methods where we just needed some abstract graph space in which to search.  Now we need data to train the parameters of the model!  And sometimes this can go perfectly well and sometimes it can go wrong.  This first video jumps right into a couple of things to watch out for in training an ML model and also introduces you to the idea of breaking your data into three sets:  training data, validation data, and testing data.

What is overfitting and what is underfitting? How does they affect how we should train our ML model?  Watch the video to learn about training/testing/validation sets and hyperparameters.

What does the training data usually look like? This is a super short video just to make sure we are on the same page for notation for the methods later on.


No exercises for this module.  Just go right to the next module!