stepwise-regression

所属分类:数值算法/人工智能
开发工具:Python
文件大小:219KB
下载次数:1
上传日期:2022-07-28 15:11:14
上 传 者sh-1993
说明:  逐步回归符合逻辑回归模型,其中预测变量的选择是通过自动正向逐步过程进行的。
(Stepwise regression fits a logistic regression model in which the choice of predictive variables is carried out by an automatic forward stepwise procedure. ,)

文件列表:
LICENSE (1070, 2022-07-28)
examples (0, 2022-07-28)
examples\Example_1.ipynb (137744, 2022-07-28)
pyproject.toml (102, 2022-07-28)
setup.cfg (647, 2022-07-28)
stepreg (0, 2022-07-28)
stepreg\__init__.py (0, 2022-07-28)
stepreg\__pycache__ (0, 2022-07-28)
stepreg\__pycache__\__init__.cpython-37.pyc (158, 2022-07-28)
stepreg\__pycache__\modul.cpython-37.pyc (263, 2022-07-28)
stepreg\stepreg.py (8862, 2022-07-28)
stepwise-regression.zip (81420, 2022-07-28)
stepwise_example.jpg (67598, 2022-07-28)

# stepwise-regression Stepwise regression fits a logistic regression model in which the choice of predictive variables is carried out by an automatic forward stepwise procedure. The stepwise selection process can be visualized and shows the saturation in terms of AUC. Furthermore it is possible to use early stopping to get an parsimonious model. ![alt text](https://github.com/Mathias-Kreis/stepwise-regression/blob/main/stepwise_example.jpg?raw=true|width=50px) ## Installation Instructions The package can be installed from GitHub using pip: ```python pip install https://github.com/Mathias-Kreis/stepwise-regression/stepwise-regression.zip ``` If you have issues to install the package, it is possible to just download stepwise-regression.zip and navigate via anaconda prompt to the unpacked package location and install it with ```python pip install . ``` ## Getting started To use the functionality of stepwise-regression you just have to import the main function Logitstep as follows: ```python from stepreg.stepreg import Logitstep ``` Here you can see the Logitstep function with input parameter: ```python logit_results, logit_model, steplist = Logitstep( y, X, maxsteps=30, p=0.05, force=["intercept"], plot=True, early_stopping=False, patience=10, tol=0.001, verbosity=1 ) ``` The function returns three Objects: the model summary, the estimated model itself and a list of selected variables. Having the function ready for action, just give it a try, but bear in mind that you prepare your data properly. ## Example You can find an [example](https://github.com/Mathias-Kreis/stepwise-regression/tree/main/examples) in the main branch which models Fraud data that can be find on [kaggle](https://www.kaggle.com/datasets/volodymyrgavrysh/fraud-detection-bank-dataset-20k-records-binary). In particular you can find a possible data prepartion before running Logitstep. ## Remark The package is still under construction. I am thankful for hints and comments!

近期下载者

相关文件


收藏者