首页 > 其他 > 详细

sklearn 通过检查是否具有属性确定是否拟合过了

时间:2018-11-10 18:34:56      阅读:130      评论:0      收藏:0      [点我收藏+]

As model_selection.GridSearchCV uses set_params to apply parameter setting to estimators, it is essential that calling set_params has the same effect as setting parameters using the init method. The easiest and recommended way to accomplish this is to not do any parameter validation in init. All logic behind estimator parameters, like translating string arguments into functions, should be done in fit.

Also it is expected that parameters with trailing _ are not to be set inside the init method. All and only the public attributes set by fit have a trailing . As a result the existence of parameters with trailing is used to check if the estimator has been fitted.

sklearn 通过检查是否具有属性确定是否拟合过了

原文:https://www.cnblogs.com/wdmx/p/9940055.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!