且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GridSearchCV最终模型

更新时间:2023-12-01 23:19:40

GridSearchCV将返回具有很多信息的对象.确实会返回在剩余数据上表现***的模型:

The GridSearchCV will return an object with quite a lot information. It does return the model that performs the best on the left-out data:

best_estimator_:估计量或字典

best_estimator_ : estimator or dict

通过搜索选择的估算器,即给出 剩余数据的最高得分(或最小损失,如果指定). 如果refit = False,则不可用.

Estimator that was chosen by the search, i.e. estimator which gave highest score (or smallest loss if specified) on the left out data. Not available if refit=False.

请注意,这不是对整个数据进行训练的模型.这意味着,一旦确信这是您想要的模型,就需要自己对整个数据重新训练模型.

Note that this is not the model that's trained on the entire data. That means, once you are confident that this is the model you want, you will need to retrain the model on the entire data by yourself.

参考: http://scikit-learn.org /stable/modules/generated/sklearn.model_selection.GridSearchCV.html