Skip to main content

Sparse Partial Robust M Regression, including plot functions

Project description

Sparse partial robust M regression

A scikit-learn compatible Python 3 package for robust multivariate regression and dimension reduction statistics, including:

  • Sparse Partial Robust M regresion (SPRM)[1], a sparse and robust version of univariate partial least squares (PLS1).
  • Sparse NIPALS Regression (SNIPLS)
  • Robust M regression
  • Robust centring and scaling

AIG sprm score space

Description

The SPRM method performs four tasks at the same time in a single, consistent estimate:

  • regression: yields regression coefficients and predicts responses
  • dimension reduction: calculates interpretable PLS-like components maximizing covariance to the predictand in a robust way
  • variable selection: depending on the paramter settings, can yield highly sparse regression coefficients that contain exact zero elements
  • outlier detection and compensation: yields a set of case weights in [0,1]. The lower the weight, the more outlying a case is. The estimate itself is outlier robust.

Note: all the methods contained in this package have been designed for continuous data. They do not work correctly for caetgorical or textual data.

The code is aligned to ScikitLearn, such that modules such as GridSearchCV can flawlessly be applied to it.

The repository contains

  • The estimator (sprm.py)
  • Plotting functionality based on Matplotlib (sprm_plot.py)
  • Options for data pre-processing (robcent.py)
  • The Sparse NIPALS (SNIPLS) estimator [3](snipls.py)
  • Robust M regression estimator (rm.py)
  • Ancillary functions for plotting (_plot_internals.py)
  • Ancillary functions for M-estimation (_m_support_functions.py)
  • Ancillary functions for preprocessing (_preproc_utilities.py)

How to install

The package is distributed through PyPI, so install through:

    pip install sprm 

Documentation

Detailed documentation on how to use the classes is provided in the Documentation file.

Examples

For examples, please have a look at the SPRM Examples Notebook.

References

  1. Sparse partial robust M regression, Irene Hoffmann, Sven Serneels, Peter Filzmoser, Christophe Croux, Chemometrics and Intelligent Laboratory Systems, 149 (2015), 50-59.
  2. Partial robust M regression, Sven Serneels, Christophe Croux, Peter Filzmoser, Pierre J. Van Espen, Chemometrics and Intelligent Laboratory Systems, 79 (2005), 55-64.
  3. Sparse and robust PLS for binary classification, I. Hoffmann, P. Filzmoser, S. Serneels, K. Varmuza, Journal of Chemometrics, 30 (2016), 153-162.

Release Notes can be checked out in the repository.

A list of possible topics for further development is provided as well. Additions and comments are welcome!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sprm-0.7.0-py3-none-any.whl (29.8 kB view hashes)

Uploaded Python 3

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