Multivariate multiple linear regression using Sklearn
问题 I want to train a linear model Y = M_1*X_1 + M_2*X_2 using sklearn with multidimensional input and output samples (e.g. vectors). I tried the following code: from sklearn import linear_model from pandas import DataFrame x1 = [[1,2],[2,3],[3,4]] x2 = [[1,1],[3,2],[3,5]] y = [[1,0],[1,2],[2,3]] model = { 'vec1': x1, 'vec2': x2, 'compound_vec': y} df = DataFrame(model, columns=['vec1','vec2','compound_vec']) x = df[['vec1','vec2']].astype(object) y = df['compound_vec'].astype(object) regr =