AI engineering glossary · ML fundamentals

What is stratified k-fold?

Stratified k-fold (also called Stratified cross-validation): A version of k-fold cross-validation that keeps the proportion of each class roughly the same in every fold as in the full data. It prevents a fold from having too few or no examples of a rare class, which would make scores misleading.

Level: intermediateTopic: ML fundamentals

Stratified k-fold: an example

If 5% of 2,000 transactions are fraud, every fold has about 20 fraud cases out of 400 instead of some folds getting almost none.

Related terms

More ML fundamentals terms

Where you learn it

Stratified k-fold is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.