码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-11-10 19:05:53      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:ali   call   params   sed   ati   public   calling   sse   into   

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 通过检查是否具有属性确定是否拟合过了

标签:ali   call   params   sed   ati   public   calling   sse   into   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!