Skip to main content

Statistically rigorous model trust evaluation: calibration, uncertainty, and representation quality — with CIs and significance tests on every metric.

Project description

reliably

Statistically rigorous model reliability evaluation — every metric carries a confidence interval, every comparison carries a significance test.

pip install reliably

Five-line quick start

import numpy as np
import reliably as rb

y_true = np.array([0, 1, 1, 0, 1, ...])  # your labels
y_prob = model.predict_proba(X)           # your probabilities

report = rb.evaluate(y_true, y_prob)
print(report.summary())
# Report(task=binary, n=1000)
#   ECE=0.0312 [0.0211, 0.0421]
#   smECE=0.0289 [0.0185, 0.0398]
#   Brier=0.1842 [0.1714, 0.1971]
#   NLL=0.5103 [0.4887, 0.5319]
#   AUROC=0.7841 [0.7512, 0.8170]

The "wow" comparison

result = rb.compare(report_a, report_b, y_true=y_true, metric="auroc")
if not result.significant:
    print(f"AUROC difference NOT significant (p={result.p_value:.2f})")

Why reliably?

Feature reliably netcal Uncertainty Toolbox Torch-Uncertainty
Bootstrap CIs on every metric Partial
DeLong significance test
Paired bootstrap comparison
LLM confidence calibration
Representation quality (MIG, DCI…)
Statistical coverage test suite
Framework-agnostic (numpy/torch/jax) ✗ (torch only)
Actively maintained Partial

Metrics included

Calibration

  • ECE (equal-width and adaptive binning)
  • SmoothECE (kernel regression, recommended headline metric)
  • Debiased ECE² (bias-corrected)
  • Maximum Calibration Error (MCE)
  • Classwise / marginal ECE

Scoring rules

  • Brier score with Murphy decomposition (reliability + resolution + uncertainty)
  • Negative Log-Likelihood

Discrimination

  • AUROC with DeLong analytic CI and two-sample correlated test

Recalibration

  • Temperature scaling, vector scaling, matrix scaling
  • Platt scaling, isotonic regression, beta calibration, histogram binning

Representation quality (reliably.repr)

  • MIG, SAP, DCI, FactorVAE, IRS — all with bootstrap CIs

LLM confidence (reliably.llm)

  • Verbalized confidence parsing
  • Sequence log-probability → confidence
  • Adapters for LM-Polygraph and UQLM

Installation

# Core (numpy + scipy only)
pip install reliably

# With visualization
pip install reliably[viz]

# With HTML reports
pip install reliably[report]

# With scikit-learn (isotonic regression, DCI)
pip install reliably[sklearn]

# Everything
pip install reliably[all]

Links


License

Apache-2.0

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

reliably_metrics-0.1.0.tar.gz (62.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reliably_metrics-0.1.0-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file reliably_metrics-0.1.0.tar.gz.

File metadata

  • Download URL: reliably_metrics-0.1.0.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reliably_metrics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c9996e392c89ca097123a2dfff9299f448c7942970b40e0300cb810d0ab2c801
MD5 762688da59ec1cecb97fcad191a3b50d
BLAKE2b-256 a199214857d098f79652db053da00e0fe55f0da468102dd1349a6b6b5fff56db

See more details on using hashes here.

Provenance

The following attestation bundles were made for reliably_metrics-0.1.0.tar.gz:

Publisher: release.yml on nischal1234/reliably

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reliably_metrics-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reliably_metrics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e96814189227c1caf765c53a8342dc730b76e2f6b775f78ed64a1a658c1cc128
MD5 c62d115290e3d5cbb9ac9eaefbae7b1d
BLAKE2b-256 987bc8125bc6d219fa512a641b6db48c7fd3bf782d7238cfee6f8c604a3a446a

See more details on using hashes here.

Provenance

The following attestation bundles were made for reliably_metrics-0.1.0-py3-none-any.whl:

Publisher: release.yml on nischal1234/reliably

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page