gridsearchcv中的refit选项是否会重新选择功能?

时间:2019-09-04 08:43:10

标签: python feature-selection gridsearchcv refit

我正在使用gridsearchcv来训练逻辑回归分类器。我想知道的是,refit命令是否基于选择的超参数C重新选择特征,还是仅使用在交叉验证过程中选择的特征,而仅重新拟合系数的值而无需重新选择特征? / p>

1 个答案:

答案 0 :(得分:0)

根据GridSearchCV的文档:

1. Refit an estimator using the best found parameters on the whole dataset.
2. The refitted estimator is made available at the best_estimator_ attribute and permits using predict directly on this GridSearchCV instance.

从这里Confused with repect to working of GridSearchCV,您可以了解到refit参数的重要性。

refit : boolean
    Refit the best estimator with the entire dataset. 
    If “False”, it is impossible to make predictions using 
    this GridSearchCV instance after fitting.