K折的迭代训练模型吗
如果您在数据集上运行cross-val_score()或cross_validate(),是否在运行结束时使用所有折叠训练了估算器?
我在某个地方阅读了cross-val_score获取估算器的副本。而我认为这是您使用k折训练模型的方式。
或者,在cross_validate()或cross_val_score()的末尾,您有一个估计器,然后将其用于preditive()
我的想法正确吗?
If you run cross-val_score() or cross_validate() on a dataset, is the estimator trained using all the folds at the end of the run?
I read somewhere that cross-val_score takes a copy of the estimator. Whereas I thought this was how you train a model using k-fold.
Or, at the end of the cross_validate() or cross_val_score() you have a single estimator and then use that for predict()
Is my thinking correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以参考 norelowl noreferrer“> sklearn-document skein> in。
如果您进行3倍的交叉验证,则
因此,在使用
跨validate
之后,您将获得三个模型。如果需要每个回合的模型对象,则可以添加参数return_estimato = true
。结果是字典将具有另一个名为估算器
的密钥,其中包含每个培训的估计器列表。但是,实际上,交叉验证方法仅用于测试模型。找到良好的模型和参数设置后,可以为您提供高跨验证评分。如果您再次使用整个训练集合并使用测试集测试模型,那将是更好的。
You can refer to sklearn-document here.
If you do 3-Fold cross validation,
So, after using
cross-validate
, you will get three models. If you want the model objects of each round, you can add parameterreturn_estimato=True
. The result which is the dictionary will have another key namedestimator
containing the list of estimator of each training.However, in practice, the cross validation method is used only for testing the model. After you found the good model and parameter setting that give you the high cross-validation score. It will be better if you fit the model with the whole training set again and test the model with the testing set.