{"id":14970681,"url":"https://github.com/sanjaradylov/scikit-fallback","last_synced_at":"2025-10-26T13:31:09.400Z","repository":{"id":244934364,"uuid":"816788181","full_name":"sanjaradylov/scikit-fallback","owner":"sanjaradylov","description":"Machine Learning with a Reject Option","archived":false,"fork":false,"pushed_at":"2025-01-22T13:21:09.000Z","size":516,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T19:11:12.584Z","etag":null,"topics":["fallback-classification","machine-learning","scikit-learn","selective-classification"],"latest_commit_sha":null,"homepage":"https://scikit-fallback.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanjaradylov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-18T12:05:35.000Z","updated_at":"2025-01-31T07:37:45.000Z","dependencies_parsed_at":"2024-06-27T10:45:17.282Z","dependency_job_id":"cf2e088b-f74e-457e-aede-5f04f8ca24a4","html_url":"https://github.com/sanjaradylov/scikit-fallback","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"936d55c6b16754507fe824b7d70e52d643fa66c5"},"previous_names":["sanjaradylov/scikit-fallback"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjaradylov%2Fscikit-fallback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjaradylov%2Fscikit-fallback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjaradylov%2Fscikit-fallback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjaradylov%2Fscikit-fallback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanjaradylov","download_url":"https://codeload.github.com/sanjaradylov/scikit-fallback/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238337258,"owners_count":19455279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fallback-classification","machine-learning","scikit-learn","selective-classification"],"created_at":"2024-09-24T13:43:59.010Z","updated_at":"2025-10-26T13:31:09.011Z","avatar_url":"https://github.com/sanjaradylov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![PyPi](https://img.shields.io/pypi/v/scikit-fallback)\n[![Downloads](https://static.pepy.tech/badge/scikit-fallback)](https://pepy.tech/project/scikit-fallback)\n![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)\n[![CodeFactor](https://www.codefactor.io/repository/github/sanjaradylov/scikit-fallback/badge)](https://www.codefactor.io/repository/github/sanjaradylov/scikit-fallback)\n![Python package workflow](https://github.com/sanjaradylov/scikit-fallback/actions/workflows/python-package.yml/badge.svg)\n[![PythonVersion](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/downloads/release/python-3913/)\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Fsanjaradylov%2Fscikit-fallback)](https://x.com/intent/tweet?text=Wow:%20https%3A%2F%2Fgithub.com%2Fsanjaradylov%2Fscikit-fallback%20@sanjaradylov)\n[![Twitter Follow](https://img.shields.io/twitter/follow/sanjaradylov?style=social)](https://twitter.com/sanjaradylov)\n\n**scikit-fallback** is a scikit-learn-compatible Python package for machine learning\nwith a reject option.\n\n### 👩‍💻 Usage\n\nTo allow your probabilistic pipeline to *fallback*—i.e., abstain from predictions—you can\nwrap it with a `skfb` *rejector*. Training a rejector means both fitting your model and\nlearning to accept or reject predictions. Evaluation of a rejector depends\non *fallback mode* (inference with or without *fallback labels*) and measures the ability\nof the rejector to both accept correct predictions and reject ambiguous ones.\n\nFor example, `skfb.estimators.ThresholdFallbackClassifierCV` fits the base estimator and then\nfinds the best confidence threshold via cross-validation. If `fallback_mode == \"store\"`, then the\nrejector returns `skfb.core.array.FBNDArray` of predictions and a sparse fallback-mask property,\nwhich lets us summarize the accuracy of both predictions and rejections.\n\n```python\nfrom skfb.estimators import ThresholdFallbackClassifierCV\nfrom sklearn.linear_model import LogisticRegressionCV\n\nrejector = ThresholdFallbackClassifierCV(\n    LogisticRegressionCV(cv=4, random_state=0),\n    thresholds=10,\n    ambiguity_threshold=0.05,\n    cv=5,\n    fallback_label=-1,\n    fallback_mode=\"store\",\n)\nrejector.fit(X_train, y_train)  # Train base estimator and learn best threshold\nrejector.score(X_test, y_test)  # Compute acceptance-correctness accuracy score\n```\n\nAnd for more motivation and information on usage, please visit our\n[documentation](https://scikit-fallback.readthedocs.io/en/latest/index.html)\nand refer to the\n[Medium series](https://medium.com/@sshadylov) on machine learning with a reject option.\n\n\n### 🏗 Installation\n`scikit-fallback` requires:\n* Python (\u003e=3.9,\u003c3.13)\n* scikit-learn (\u003e=1.0)\n* numpy\n* scipy\n* matplotlib (\u003e=3.0) (optional)\n\nand along with the requirements can be installed via `pip` :\n\n```bash\npip install -U scikit-fallback\n```\n\n\n### 📚 Examples\n\nSee the [`examples/`]([examples/](https://github.com/sanjaradylov/scikit-fallback/tree/main/examples))\ndirectory for various applications of fallback estimators\nand scorers to scikit-learn-compatible pipelines.\n\n### 🔗 References\n\n1. Hendrickx, K., Perini, L., Van der Plas, D. et al. Machine learning with a reject option: a survey. Mach Learn 113, 3073–3110 (2024). https://doi.org/10.1007/s10994-024-06534-x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjaradylov%2Fscikit-fallback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanjaradylov%2Fscikit-fallback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjaradylov%2Fscikit-fallback/lists"}