spectre
spectre

Reputation: 767

GridSearchCV first and then k fold CV or the other way round?

I am having a lot of confusion between GridSearchCV and K fold Cross Validation. I know that GridSearch is only for hyperparameter optimization and K Fold will split my data into K folds and iterate over them (cv value). So should I first split my data into train and validation sets, apply GridSearch on training data for "best parameters" and then use K Fold on my training data using the "best parameters" I got from GridSearch?

Upvotes: 1

Views: 241

Answers (1)

Gee
Gee

Reputation: 85

GirdsearchCV itself performs cross validation for HP tuning. So no need to perform it separately.

Also it would be much better if you perform NestedCV instead of only Gridsearch. Plain old vanilla cv gives you an over positive estimate which is biased optimistically. Nested CV reduces this bias to an extent.

Upvotes: 1

Related Questions