Implementation of the Views stepshifting modelling framework
Project description
stepshift
Stepshift is a package that implements the stepshifting algorithm described in appendix A of
Hegre et al. (2020).
Installation
Stepshift is currently only distributed as a source distribution, which means that the end user needs a C compiler. This means that OSX users need to have Xcode installed on their system before proceeding. In addition, the numpy requirement is quite strict, since stepshift uses the Numpy C API via Cython.
Install by running:
pip install stepshift
Usage
Stepshift has a module called stepshift.views
which contains a class called
StepshiftedModels
. This class wraps the stepshifting procedure, exposing a
simple, Scikit-Learn-like (but not equivalent) API. The model takes three
arguments: A scikit learn estimator, a list containing integers, which denotes
the steps, and a string variable which is the name of the dependent variable:
from sklearn.linear_model import LogisticRegression
from stepshift.views import StepshiftedModels
mdl = StepshiftedModels(LogisticRegression(),[1,2,3,4,5,6,7,8],"outcome")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file stepshift-2.2.3.tar.gz
.
File metadata
- Download URL: stepshift-2.2.3.tar.gz
- Upload date:
- Size: 161.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b94e76112a09bd26b24c95ce9e546deb15bf7af5832a8e782a909e793c3505d7 |
|
MD5 | 60e0331f70554c3aa46521f11c168698 |
|
BLAKE2b-256 | 83f84808e49e138350e5010eb90f1b47c0997673e6b5f3f10a08ebb36b8cd824 |