python-causality-handbook
python-causality-handbook copied to clipboard
Issue on page /15-Synthetic-Control.html
In the code
from sklearn.linear_model import LinearRegression weights_lr = LinearRegression(fit_intercept=False).fit(X, y).coef_ weights_lr.round(3)
Isn't it fit(y, X)
instead of fit(X, y)
?
Hey, from looking at the API it seems like the order is correct. The predictor comes first: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression.fit