Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.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_Feature Selection_Gridsearchcv_Refit - Fatal编程技术网

Python gridsearchcv中的重新安装选项是否重新选择功能?

Python gridsearchcv中的重新安装选项是否重新选择功能?,python,feature-selection,gridsearchcv,refit,Python,Feature Selection,Gridsearchcv,Refit,我正在使用gridsearchcv来训练逻辑回归分类器。我想知道的是,refit命令是基于所选的超参数C重新选择特征,还是仅仅使用交叉验证过程中选择的特征,只重新拟合系数值而不重新选择特征?根据GridSearchCV的文档: 从这里可以得到以下refit参数的重要性 refit : boolean Refit the best estimator with the entire dataset. If “False”, it is impossible to make pre

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

根据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.

非常感谢你!我已经看到了这些答案,但我仍然感到困惑。我认为该算法应该使用选定的超参数构造新的目标函数,因此所有的特征都应该在整个训练样本的基础上重新选择。但我只是想确保我理解正确。所以refit命令重新选择功能正确吗?您的理解几乎是正确的。实际上,如果我们保持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.