Built with Mathigon

Glossary

Select one of the keywords on the left…

Testing Your AIIntroduction

Reading time: ~5 min

Imagine a student preparing for a massive final exam. If their teacher hands them a practice test, and the exact same questions magically appear on the actual final, what does their perfect score actually prove? It simply proves that the student memorized the answers! It doesn’t tell you whether they truly understood the subject.

The exact same problem happens in machine learning. If we evaluate an AI using the precise data it used to learn (its "training data"), the AI will look like an absolute simply because it memorized the answers. We won't know if it can actually "generalize" and perform well on brand-new, unseen data.

To make sure we have this locked in:

Why shouldn't we test our AI on its own training data?

It takes too long to compute the results.
The model will look artificially perfect by memorizing answers.
It requires too many data points to work properly.

Since constantly collecting brand new real-world data to test our AI is extremely expensive and time-consuming, we need a clever way to securely test our model's true abilities using only the data we already have. This chapter introduces the absolute gold standard for safely testing your model without needing new data: K-Fold Cross-Validation.

First, we are going to quickly review the standard "Validation Set", and then dive deep into how K-Fold Cross-Validation completely supercharges that technique to guarantee the most reliable test scores possible. We'll also break down the importance of choosing the right value for the magical k variable!

Sina