📅  最后修改于: 2022-03-11 14:45:04.145000             🧑  作者: Mango
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.