The Threat of Overfitting

Learn how overfitting can ruin the model.

Soon enough, we’ll get to tune our neural network and make it as accurate as possible. Before we do that, however, we need a reliable test to measure that accuracy. As it turns out, ML testing comes with a subtly counterintuitive hurdle that can easily complicate things .

Side note: This short chapter tells us where that testing trapdoor is, and how to step around it.

Overfitting

Since the first part of this course, we’ve been using two separate sets of examples: one for training our algorithms, and one for testing them. Let’s refresh our memory: why do we not use the same examples for both training and testing?

Let’s use a metaphor to answer that question. Imagine we teach basic math to a class of young kids. We’ve already prepared 60 multiple-answer multiplication quizzes. We plan to assign most of those quizzes as homework. We also plan to select 10 quizzes for a final test to check how well the kids are learning.

We want to split the ...