1
$\begingroup$

During k-fold cross-validation, is it possible that a model is so sophisticated (e.g., with many hyperparameters to be grid searched) that it gives a good score on almost every validation fold? It's like the model is intricate enough to somehow leak out to fit the validation set every time (there are k times), essentially overfitting the whole training set (because the sum of the k validation folds is just the whole training set).

If this is possible, then I feel like it's also possible that this best model will eventually have a high generalization error when tested on the final test set, essentially making cross-validation useless. Did I miss anything here?

$\endgroup$

1 Answer 1

0
$\begingroup$

I don't think model can "somehow leak out to fit the validation set every time", what however can (and does) happen is that you test many models and choose the one with best score on k-fold. If the models are complex enough and you test many of them, some will fit the validation fold simply by chance.

The model chosen by cross-validation can thus have a high generalization error on completely new data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.