# Cross-Validation

Cross-validation splits the rows into k folds and tests the model on each fold in turn, learning from the others, so every row is tested exactly once; cross_val_score gives the k scores, you report their mean and their spread, and KFold with shuffle=True and a random_state makes the folds random and repeatable.

![Cheat sheet: Cross-Validation](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/74da3488210341df8a5b62b91b946849.webp)

- Category: Machine Learning
- Level: Journeyman
- Tags: ai, Cross-Validation, K-Fold Cross-Validation, python, Random Seed, Standard Deviation
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/ml-cross-validation-cheat-sheet
