Search code examples
pythonmachine-learningscikit-learngridsearchcv

Does GridSearchCV in sklearn train the model with whole data set?


I know that GridSearchCV will find the 'best' hyper-parameter by using k-fold cv. But after finding those hyper-parameters, will the GridSearchCV train the model again with the whole data set to get the trainable parameters? Or it only trains the model with the folds that generated the best hyper-parameters?


Solution

  • According to sklearn documentation:

    lookup the keyword refit defaulted to be True. I believe this answers your question.