from sklearn import linear_model
reg = linear_model.LinearRegression()
reg.fit(example, label)
print("Coefficients of sklearn: W=%s, b=%f" % (reg.coef_, reg.intercept_))
其中example时特征值,label是标签
from sklearn import linear_model
reg = linear_model.LinearRegression()
reg.fit(example, label)
print("Coefficients of sklearn: W=%s, b=%f" % (reg.coef_, reg.intercept_))
其中example时特征值,label是标签