What is cross-validation? How to do it right?
It's a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. Mainly used in settings where the goal is prediction and one wants to estimate how accurately a model will perform in practice. The goal of cross-validation is to define a data set to test the model in the training phase (i.e. validation data set) in order to limit problems like overfitting, and get an insight on how the model will generalize to an independent data set. Examples: leave-one-out cross validation, K-fold cross validation. How to do it right? The training and validation data sets have to be drawn from the same population. Predicting stock prices: trained for a certain 5-year period, it's unrealistic to treat the subsequent 5-year a draw from the same population. Common mistake: for instance the step of choosing the kernel parameters of a SVM should be cross-validated as well. Bias-variance trade-off for k-fold cross ...