1.1. Linear Models — scikit-learn 1.0.2 documentation
https://scikit-learn.org/stable/modules/linear_model.htmlLinearRegression will take in its fit method arrays X, y and will store the coefficients w of the linear model in its coef_ member: >>> >>> from sklearn import linear_model >>> reg = linear_model.LinearRegression() >>> reg.fit( [ [0, 0], [1, 1], [2, 2]], [0, 1, 2]) LinearRegression () >>> reg.coef_ array ( [0.5, 0.5])