easyAI & Machine Learning FundamentalsReviewed Jul 24, 2026

What is k-fold cross-validation and why is it useful?

K-fold cross-validation is a resampling technique for estimating how well a model generalizes. The data is split into k equal folds; the model is trained k times, each time using k-1 folds for training and the remaining fold for validation, and the results are averaged. This uses all data for both training and validation, giving a more reliable, lower-variance performance estimate than a single train/test split, which is especially valuable on small datasets. Common choices are k=5 or k=10. For classification with imbalanced classes, use stratified k-fold to preserve class proportions in each fold. For time series, use forward-chaining splits instead, since standard k-fold would leak future information into the past. Its main cost is training k times.

cross-validationevaluationmodel-selection

More AI & Machine Learning Fundamentals questions

See all AI & Machine Learning Fundamentals questions →