What is K-fold cross-validation?
Classic MLLevel: FoundationValidation
What is K-fold cross-validation?
Hints
- Which observations must remain independent during evaluation?
- Compare random, grouped and temporal splits. Where are hyperparameters selected?
Answer
K fold cross validation is a method of cross validation where we select a hyperparameter k. The dataset is now divided into k parts. Now, we take the 1st part as validation set and remaining k-1 as training set. Then we take the 2nd part as validation set and remaining k-1 parts as training set. Like this, each part is used as validation set once and the remaining k-1 parts are taken together and used as training set. It should not be used in a time series data.
Source and licence: Alexey Grigorev & contributors — Data Science Interviews · CC-BY-4.0