Skip to main content

Library for minimax risk classifiers

Project description

MRCpy: A Library for Minimax Risk Classifiers

Build Status Coverage Status

MRCpy implements recently proposed supervised classification techniques called minimax risk classifiers (MRCs). MRCs are based on robust risk minimization and can utilize 0-1 loss, in contrast to existing libraries using techniques based on empirical risk minimization and surrogate losses. Such techniques give rise to a manifold of classification methods that can provide tight bounds on the expected loss, enable efficient learning in high dimensions, and adapt to distribution shifts. MRCpy provides a unified interface for different variants of MRCs and follows the standards of popular Python libraries. This library also provides implementation for popular techniques that can be seen as MRCs such as L1-regularized logistic regression, zero-one adversarial, and maximum entropy machines.

Algorithms

Installation

Python 3.6

The latest built version of MRCpy can be installed using pip as

pip install MRCpy

Alternatively, the development version (GitHub) of MRCpy can be installed as follows

git clone https://github.com/MachineLearningBCAM/MRCpy.git
cd MRCpy
python3 setup.py install

NOTE: The solver based on CVXpy in the library uses GUROBI optimizer which requires a license. You can get a free academic license from here.

Dependencies

  • Python >= 3.8
  • numpy >= 1.18.1, scipy>= 1.4.1, scikit-learn >= 0.21.0, cvxpy, mosek, pandas

Usage

See the MRCpy documentation page for full documentation about installation, API, usage, and examples.

Citations

This repository is the official implementation of Minimax Risk Classifiers proposed in the following papers. If you use MRCpy in a scientific publication, we would appreciate citations to:

Updates and Discussion

You can subscribe to the MRCpy's mailing list for updates and discussion

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

MRCpy-2.1.6.tar.gz (2.3 MB view hashes)

Uploaded Source

Built Distribution

MRCpy-2.1.6-py3-none-any.whl (2.7 MB 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