且构网

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

GridSearchCV 最终模型

更新时间:2023-12-01 23:33:58

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