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.10

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.19,
  • scipy >= 1.4.1,
  • scikit-learn >= 0.22,
  • cvxpy >= 1.1,
  • gurobipy

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.3.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

MRCpy-2.3.0-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

Details for the file MRCpy-2.3.0.tar.gz.

File metadata

  • Download URL: MRCpy-2.3.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for MRCpy-2.3.0.tar.gz
Algorithm Hash digest
SHA256 abb3113416db2e1a65622aed26c3f80eb184316fa3711dce739c13bc2f7e4445
MD5 5d9f1a8c87c2e33f3a2bfaae1b6e65f4
BLAKE2b-256 f89285d1650a1cd870840d34c280ebe262ff5d98f3ef7563be33d489a7edebcb

See more details on using hashes here.

File details

Details for the file MRCpy-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: MRCpy-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for MRCpy-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0115634bd067c03ba60f6b6fe508ed83044ae1af0cc7bbb992a2d6577ce18f
MD5 3a0a8162bb5243c9f53fa883fe4fedf3
BLAKE2b-256 ea380f509dd89becdf59960bffbb485397ee37cb69f691e8edd8fe127b9ff474

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