📜  python代码示例中的多元线性回归

📅  最后修改于: 2022-03-11 14:45:04.145000             🧑  作者: Mango

代码示例1
from sklearn import linear_model
clf = linear_model.LinearRegression()
clf.fit([[getattr(t, 'x%d' % i) for i in range(1, 8)] for t in texts],
        [t.y for t in texts])
#clf.coef_ will have the regression coefficients.