chapter four
4 Optimizing the training process: Underfitting, overfitting, testing, and regularization
This mini-chapter covers
- What is underfitting and overfitting?
- Underfitting and overfitting in regression models.
- A solution for avoiding overfitting: Testing the model.
- Using a model complexity graph to make decisions on our model.
- Another solution to avoid overfitting: Regularization.
- Calculating the complexity of the model using the L1 and L2 norms.
- Picking the best model in terms of performance and complexity.
This chapter is different from the majority of the chapters in this book, as it doesn’t contain a particular machine learning algorithm. Instead, it contains some potential problems that machine learning models may face, and effective practical ways to solve them.
Imagine that you have learned some great machine learning algorithms, and you are ready to apply them. You go to work as a data scientist and your first task is to build a machine learning model for a dataset of customers. You build it and put it in production. However, everything goes wrong and the model doesn’t do a good job making predictions. What happened?