Skip to main content

Machine learning with a reject option

Project description

License PythonVersion Black linting: pylint

scikit-fallback is a scikit-learn-compatible Python package for machine learning with a reject option.

Get started w/ scikit-fallback

Usage

from skfb.estimators import RateFallbackClassifierCV
from skfb.metrics import predict_reject_accuracy_score
from sklearn.linear_model import LogisticRegression

rejector = RateFallbackClassifierCV(
    LogisticRegression(),
    fallback_rates=[0.05, 0.07],
    cv=5,
)
rejector.fit(X_train, y_train)
y_pred = rejector.predict(X_test)
print(predict_reject_accuracy_score(y_test, y_pred))

Installation

scikit-fallback requires:

  • Python (>=3.9,< 3.13)
  • scikit-learn (>=1.3)

Examples

See the examples/ directory for various applications of fallback estimators and scorers to scikit-learn-compatible pipelines.

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

scikit_fallback-0.0.0.tar.gz (31.8 kB view hashes)

Uploaded Source

Built Distribution

scikit_fallback-0.0.0-py3-none-any.whl (29.6 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