Conformal selective prediction with general risk control.
Project description
SCoRE
SCoRE implements conformal selective prediction procedures for marginal deployment risk (MDR) and selective deployment risk (SDR) control.
This repository also contains the simulation and application code used for the paper Conformal Selective Prediction with General Risk Control.
Installation
Install the package from a local checkout:
python -m pip install -e .
Install optional dependencies for the research scripts:
python -m pip install -e ".[experiments]"
After the package is published, install it with:
python -m pip install score-select
Quickstart
import numpy as np
from SCoRE import SCoRE_MDR, SCoRE_SDR
lcalib = np.array([0, 1, 0, 1])
scalib = np.array([0.1, 0.4, 0.2, 0.8])
stest = np.array([0.15, 0.5, 0.9])
dcalib = (lcalib, scalib)
dtest = stest
mdr_selected = SCoRE_MDR(dcalib, dtest, alpha=0.5, gamma=0.5)
sdr_selected = SCoRE_SDR(dcalib, dtest, alpha=0.5, gamma=0.5)
Functions return NumPy integer index arrays, so selections can be used directly to index NumPy arrays.
When using randomized pruning, pass random_state for reproducible results:
selected = SCoRE_SDR(
dcalib,
dtest,
alpha=0.5,
gamma=1.0,
prune="hete",
random_state=123,
)
Public API
The top-level package exports the main procedures and utilities:
Recommended package entry points:
SCoRE_MDRSCoRE_SDR
Additional utilities:
CSSCoRE_MDR_bf,SCoRE_MDR_w,SCoRE_SDR_wBH,eBHeval_MDR,eval_SDRloss_Jin2023,loss_1,loss_2gen_data_Jin2023,gen_data_1,gen_data_2Lpredictor
Repository Layout
SCoRE/: installable Python packagetests/: package testsapplications/: real-data applicationsapplications/drug/: efficient, cost-aware drug discoveryapplications/icu/: clinical prediction error managementapplications/llm/: flexible LLM abstention
simulation/: simulation experimentssimulation_w/: simulation experiments with covariate shifts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file score_select-0.1.1.tar.gz.
File metadata
- Download URL: score_select-0.1.1.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3255ca113cca5b1aaf98fe6e162e83d42b98803cbb717499aae2995ddf46e1b5
|
|
| MD5 |
5be7e1c0b3bfc5a8630ba6b9b2c7a3c6
|
|
| BLAKE2b-256 |
e6c10a31fb22f52960bdb69ed02be7744b691e5e393942e810049302c5e663d7
|
File details
Details for the file score_select-0.1.1-py3-none-any.whl.
File metadata
- Download URL: score_select-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b38900a4d2e30916f70b7d942929d84ba559b0017e562fb59d7f4758113fc2f3
|
|
| MD5 |
d83270ec4764dc8b2ad1ed8c52d105e6
|
|
| BLAKE2b-256 |
2ac5e59a8b5097f07ab9413dbb6277342af46bc8c167a15e0494400fc4d8dcc6
|