OLS Regression with Python
Scikit-learn
from sklearn.linear_model import LinearRegression ols = LinearRegression() X = [[1,1],[1,3]] y = [[1],[2]] # X and y are numpy matrices ols.fit(X, y) intercept = ols.intercept_ coefficients = ols.coef_
Contents