我在尝试运行多项式回归示例时遇到值错误:
from sklearn.preprocessing import PolynomialFeatures
import numpy as np
poly = PolynomialFeatures(degree=2)
poly.fit_transform(X) ==> ERROR
错误是:
^{pr2}$
我的scikit学习版本是0.15.2
这个例子取自:http://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions
Tags:
在创建像这样的多项式特征类的对象时,您应该尝试将include\u bias设置为False
请注意,示例中的最终矩阵现在没有第一列。在
相关问题 更多 >
编程相关推荐