简体   繁体   English

RandomSearchCV如何处理模型/内存?

[英]How does RandomSearchCV handle models/memory?

I was wondering how sklearn.model_selection.RandomizedSearchCV (and for GridSearchCV in an extent) was handling models, info and memory. 我想知道sklearn.model_selection.RandomizedSearchCV (以及范围内的GridSearchCV )是如何处理模型,信息和内存的。 In fact, despite some researches, I couldn't find any resources explaining (either with n_jobs =-1 or >1 ) what was stored every stacking step. 事实上,尽管进行了一些研究,我找不到任何资源解释(使用n_jobs =-1>1 )每个堆叠步骤存储的内容。

Even though I'm pretty sure that every model is stored because you can retrieve the model with the best parameters, but does it keep every one of them? 尽管我很确定每个模型都是存储的,因为你可以检索具有最佳参数的模型,但它是否保留了每个模型? Or does it keep at every step the best one between the last constructed one with the stored one? 或者它是否保持每一步最后构建的一个与存储的一个?

Thanks in advance for your responses :) 在此先感谢您的回复:)

They does not keep any intermediate model. 他们没有保留任何中间模型。 Only the hyper-parameters and output metrics associated with each model are stored. 仅存储与每个模型相关联的超参数和输出度量。 The model with the best parameters that you can retrieve is trained in the very end on whole data (not cross-validated, because thats already been done). 具有您可以检索的最佳参数的模型最终在整个数据上进行训练(未经过交叉验证,因为已经完成了)。

You can look at my other answers which describe the GridSearchCV in more detail: 您可以查看我更详细描述GridSearchCV其他答案:

RandomizedSearchCV does the same except for the first part where the candidate parameter combinations are found out. RandomizedSearchCV执行相同的操作,除了找到候选参数组合的第一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM