Skip to main content

Functionalities for classification with rejection.

Project description

reject

Functionalities for classification with rejection.

Installation

$ pip install reject

Documentation

The documentation is deployed to reject.readthedocs.io.

Usage

from reject.reject import ClassificationRejector

y_pred  # Array of predictions. Shape (n_observations, n_classes) or (n_observations, n_samples, n_classes).
y_true  # Array of true labels. Shape (n_observations,).

# initialize the rejector
rej = ClassificationRejector(y_true_all, y_pred_all)
# single rejection point
rej.reject(threshold=0.5, unc_type="TU", relative=True, show=True)
             Non-rejected    Rejected
---------  --------------  ----------
Correct               891          20
Incorrect             109         980

  Non-rejected accuracy    Classification quality    Rejection quality
-----------------------  ------------------------  -------------------
                 0.8910                    0.9355              40.9908
# rejection curve
fig = rej.plot_reject(unc_type="TU", metric="NRA")
print(fig)

An example notebook is provided, which can be found in the "Example usage" section of the documentation.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

reject was created by Arthur Thuy. It is licensed under the terms of the Apache License 2.0 license.

Credits

reject was created with cookiecutter and the py-pkgs-cookiecutter template.

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

reject-0.2.0.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

reject-0.2.0-py3-none-any.whl (13.5 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