多元线性回归( statsmodels.formula.api )

时间:2021-07-30 20:52:39

标签: python python-3.x machine-learning

请帮我解决这个错误。 这是我的代码。

import statsmodels.formula.api as sm
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 = sm.OLS(endog = Y,exog=x_opt).fit() 
regressor_OLS.summary()

这是错误信息。

**TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''**

0 个答案:

没有答案
相关问题