tan*_*ngy 3 python machine-learning scikit-learn
GridSearchCV 实现了一种拟合方法,在该方法中执行 n 重交叉验证以确定最佳参数。之后,我们可以使用 Predict() 直接将最佳估计器应用于测试数据 - 点击此链接: - http://scikit-learn.org/stable/auto_examples/grid_search_digits.html
这里说“该模型在完整的开发集上进行了训练”
然而,我们在这里只应用了 n 折交叉验证。分类器是否也在整个数据上进行自我训练?或者只是在应用预测时选择 n 倍中具有最佳参数的训练有素的最佳估计器?
如果要使用predict,则需要设置'refit'为True。从文档中:
refit : boolean\n Refit the best estimator with the entire dataset. \n If \xe2\x80\x9cFalse\xe2\x80\x9d, it is impossible to make predictions using \n this GridSearchCV instance after fitting.\nRun Code Online (Sandbox Code Playgroud)\n\n看起来默认情况下是正确的,因此在示例中,它predict是基于整个训练集的。
| 归档时间: |
|
| 查看次数: |
2912 次 |
| 最近记录: |