I am fitting an OLS model using statsmodels. I need to return the slope of the fitted line.
model = sm.OLS(y, X)
results = model.fit()
results.fittedvalues
gives me the points of the line. How to get the slope?
results.params
包含所有使用的变量的“斜率”。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.