daily notes[35]
线性回归模型通过最小化观测值与预测值之间的残差平方和来拟合数据。该模型包含截距项w0和系数w,可通过sklearn
·
LinearRegression
- there is a following model for Linear LinearRegression.
w 0 w_0 w0 above is intercept.
the following w is coef_.
2.it is used to achieve LinearRegression that minimizing the residual sum of squares between the observed targets and the targets predicted by the linear approximation.
from sklearn import linear_model
reg = linear_model.LinearRegression()
reg.fit([[10, 10], [11, 1], [12, 12]], [10, 11, 12])
print(reg.coef_)
print(reg.intercept_)
references
更多推荐
所有评论(0)