Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 与GridSearchCV的工作原理相混淆_Python_Machine Learning_Scikit Learn - Fatal编程技术网

Python 与GridSearchCV的工作原理相混淆

Python 与GridSearchCV的工作原理相混淆,python,machine-learning,scikit-learn,Python,Machine Learning,Scikit Learn,GridSearchCV实现了一种拟合方法,在该方法中,它执行n次交叉验证以确定最佳参数。在此之后,我们可以使用predict()将最佳估计器直接应用于测试数据-如下链接:- 这里说“模型是在完整的开发集上训练的” 然而,我们在这里只应用了n次交叉验证。分类器是否也在整个数据上进行自我训练?或者,在应用predict时,它只是在n个倍数中选择参数最佳的最佳训练估计器?如果要使用predict,则需要将'refit'设置为True。从文件中: refit : boolean Refit t

GridSearchCV实现了一种拟合方法,在该方法中,它执行n次交叉验证以确定最佳参数。在此之后,我们可以使用predict()将最佳估计器直接应用于测试数据-如下链接:-

这里说“模型是在完整的开发集上训练的”


然而,我们在这里只应用了n次交叉验证。分类器是否也在整个数据上进行自我训练?或者,在应用predict时,它只是在n个倍数中选择参数最佳的最佳训练估计器?

如果要使用
predict
,则需要将
'refit'
设置为
True
。从文件中:

refit : boolean
    Refit the best estimator with the entire dataset. 
    If “False”, it is impossible to make predictions using 
    this GridSearchCV instance after fitting.
默认情况下它看起来是真的,因此在示例中,
predict
基于整个训练集