Cross Validation
Question
What is the need to perform K-fold cross validation? How it is done?
in progress
0
Machine Learning
4 years
1 Answer
757 views
Master 0
Answer ( 1 )
Your training set can contain samples which are very different from each other.
So, just splitting it into single train and test set may not expose the model to all the cases
in the training set. So, we divide the model in k-folds, that means if you have 100 observations
in the train set and you choose k=5, then you will have 5 sets of 20 observations each. Now,
you can build the model on 4-folds(80 observations) and test it on the remaining fold(20 observations).
The process is continued till each fold gets a chance to become a part of the test set.
The results are then averaged out. This method helps in preventing over-fitting and reducing the
variance in the test set.