运行regressor_OLS.summary()时出错。 错误:名称'regressor_OLS'未定义
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()