K-Fold cross-validation splits the dataset into K equal folds, trains on K-1 and validates on the remaining one in rotation; the error estimate is the mean over folds
E^=K1∑k=1KEk where
Ek is the validation error of fold k. Key variants: Stratified K-Fold (each fold keeps the global class proportion, mandatory for classification), Group K-Fold (samples of the same group — same user or experiment — never span folds, preventing group-correlation leakage), and leave-one-out (LOOCV, K=N). Bias-variance tradeoff: larger K means more training data and lower bias, but more overlap between training sets and higher variance; K=5 or 10 is the usual compromise.