Notifications
Clear all
Questions and Discussions
2
Posts
1
Users
0
Likes
3,613
Views
Topic starter
15/01/2020 10:25 pm
regressor_OLS =sm.ols(endog=y, exog=X_opt).fit()
TypeError: from_formula() missing 2 required positional arguments: 'formula' and 'data'
This topic was modified 4 years ago by amrit_3327
Topic starter
15/01/2020 10:26 pm
Guys this module is part of Linear_model class so use following code to make it work.
import statsmodels.regression.linear_model as lm X = np.append(arr=np.ones((50,1)).astype(int),values=X,axis=1)
X_opt = X[:,[0,1,2,3,4,5]]
regressor_OLS = lm.OLS(endog = y, exog = X_opt).fit()