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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9996e392c89ca097123a2dfff9299f448c7942970b40e0300cb810d0ab2c801
|
|
| MD5 |
762688da59ec1cecb97fcad191a3b50d
|
|
| BLAKE2b-256 |
a199214857d098f79652db053da00e0fe55f0da468102dd1349a6b6b5fff56db
|
Provenance
The following attestation bundles were made for reliably_metrics-0.1.0.tar.gz:
Publisher:
release.yml on nischal1234/reliably
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reliably_metrics-0.1.0.tar.gz -
Subject digest:
c9996e392c89ca097123a2dfff9299f448c7942970b40e0300cb810d0ab2c801 - Sigstore transparency entry: 1790421004
- Sigstore integration time:
-
Permalink:
nischal1234/reliably@4a2c3f7f1a447d0123d9b17d1cd92965336bd008 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/nischal1234
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c3f7f1a447d0123d9b17d1cd92965336bd008 -
Trigger Event:
push
-
Statement type:
File details
Details for the file reliably_metrics-0.1.0-py3-none-any.whl.
File metadata
- Download URL: reliably_metrics-0.1.0-py3-none-any.whl
- Upload date:
- Size: 52.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e96814189227c1caf765c53a8342dc730b76e2f6b775f78ed64a1a658c1cc128
|
|
| MD5 |
c62d115290e3d5cbb9ac9eaefbae7b1d
|
|
| BLAKE2b-256 |
987bc8125bc6d219fa512a641b6db48c7fd3bf782d7238cfee6f8c604a3a446a
|
Provenance
The following attestation bundles were made for reliably_metrics-0.1.0-py3-none-any.whl:
Publisher:
release.yml on nischal1234/reliably
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reliably_metrics-0.1.0-py3-none-any.whl -
Subject digest:
e96814189227c1caf765c53a8342dc730b76e2f6b775f78ed64a1a658c1cc128 - Sigstore transparency entry: 1790421030
- Sigstore integration time:
-
Permalink:
nischal1234/reliably@4a2c3f7f1a447d0123d9b17d1cd92965336bd008 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/nischal1234
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c3f7f1a447d0123d9b17d1cd92965336bd008 -
Trigger Event:
push
-
Statement type: