【发布时间】:2021-10-06 23:13:40
【问题描述】:
我正在尝试构建简单的管道:
from sklearn.linear_model import Lasso
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
make_pipeline([
('PolynomialFeatures', PolynomialFeatures(include_bias=False)),
('Lasso', Lasso(fit_intercept=True, max_iter=1000))])
我得到了错误:
TypeError: Last step of Pipeline should implement fit or be the string 'passthrough'. '[('PolynomialFeatures', PolynomialFeatures(include_bias=False)), ('Lasso', Lasso())]' (type <class 'list'>) doesn't
怎么了?我该如何解决?
【问题讨论】:
标签: machine-learning scikit-learn