Skip to main content

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_MDR
  • SCoRE_SDR

Additional utilities:

  • CS
  • SCoRE_MDR_bf, SCoRE_MDR_w, SCoRE_SDR_w
  • BH, eBH
  • eval_MDR, eval_SDR
  • loss_Jin2023, loss_1, loss_2
  • gen_data_Jin2023, gen_data_1, gen_data_2
  • Lpredictor

Repository Layout

  • SCoRE/: installable Python package
  • tests/: package tests
  • applications/: real-data applications
    • applications/drug/: efficient, cost-aware drug discovery
    • applications/icu/: clinical prediction error management
    • applications/llm/: flexible LLM abstention
  • simulation/: simulation experiments
  • simulation_w/: simulation experiments with covariate shifts

Metadata

Release files for score-select 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for score-select 0.1.1
File Size Uploaded
score_select-0.1.1.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for score-select 0.1.1
File Interpreter ABI Platform
score_select-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / score_select-0.1.1.tar.gz

Download URL score_select-0.1.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3255ca113cca5b1aaf98fe6e162e83d42b98803cbb717499aae2995ddf46e1b5
BLAKE2b-256 checksum
How to use checksums
e6c10a31fb22f52960bdb69ed02be7744b691e5e393942e810049302c5e663d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / score_select-0.1.1-py3-none-any.whl

Download URL score_select-0.1.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b38900a4d2e30916f70b7d942929d84ba559b0017e562fb59d7f4758113fc2f3
BLAKE2b-256 checksum
How to use checksums
2ac5e59a8b5097f07ab9413dbb6277342af46bc8c167a15e0494400fc4d8dcc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page