从模型对象中检索值

Retrieving Values from Model Object

我使用以下代码来训练我的模型

trip_model = sm.OLS(x_dependent, y_variables).fit()

并将摘要打印为

trip_model.summary()

我只想从摘要中提取以下值

F-statistic , coef

如何获取?

fit function is a RegressionResults 结构返回的值。您可以查看文档以了解如何访问每个特定值:

f_statistic = trip_model.fvalue
coef = trip_model.params