0

I am using GridseachCV to tune the hyper parameters. I am having train,validation data separately. I am following predefined split approach to handle this (similarly to this):

ps = PredefinedSplit(test_fold=your_test_fold)

then set cv=ps in GridSearchCV

If I set refit parameter as true,after all parameter tuning will my model be trained on whole data or only on train data?

ray
  • 5,454
  • 1
  • 18
  • 40

1 Answers1

1

From the documentation:

refit : boolean, string, or callable, default=True

Refit an estimator using the best found parameters on the whole dataset.

Thus, yes, it will uses the whole dataset with the best hyperparameters. It does not matter whether you use the default (3 fold CV) or a split that comes from PredefinedSplit.

Community
  • 1
  • 1
xiawi
  • 1,772
  • 4
  • 19
  • 21