【发布时间】:2020-02-12 00:11:36
【问题描述】:
假设一个机器学习模型,比如 LightGBM 的LGBMRegressor,有一个属性best_iteration_。在调用fit 方法后如何访问此属性,从而利用了sklearn 的Pipeline 和MultiOutputRegressor?
对于Pipeline,我试过named_steps:
foo.named_steps['reg']
返回以下对象sklearn.multioutput.MultiOutputRegressor.
然后,我尝试了.estimators_:
foo.named_steps['reg'].estimators_
返回一个列表。但是,该列表包含提供给模型的初始参数。
有人能解释一下访问模型属性的理想方式吗?
【问题讨论】:
-
这可能是解决方案的一部分:stackoverflow.com/questions/28822756/…
标签: python scikit-learn attributes pipeline