Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stepshift-2.2.5.tar.gz (166.2 kB view details)

Uploaded Source

File details

Details for the file stepshift-2.2.5.tar.gz.

File metadata

  • Download URL: stepshift-2.2.5.tar.gz
  • Upload date:
  • Size: 166.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for stepshift-2.2.5.tar.gz
Algorithm Hash digest
SHA256 5c81fd4131c375bb18e12c744b007cb8ae83bab3d785f55c3b297d18bbe7022c
MD5 f569053ee5074664cf4ce42680390880
BLAKE2b-256 ae5444b0fdfdc13e4564abe299aa70c0022075de128ab647df04d141960ed7ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page