Stepwise Regression in Python

后端 未结 7 850
青春惊慌失措
青春惊慌失措 2020-12-24 14:26

How to perform stepwise regression in python? There are methods for OLS in SCIPY but I am not able to do stepwise. Any help in this regard

7条回答
  •  孤城傲影
    2020-12-24 14:37

    Trevor Smith and I wrote a little forward selection function for linear regression with statsmodels: http://planspace.org/20150423-forward_selection_with_statsmodels/ You could easily modify it to minimize a p-value, or select based on beta p-values with just a little more work.

提交回复
热议问题