Calibration of Binary and Multiclass Probabilities
Overview
Provides S3 calibrators, metrics, and diagnostics for binary and multiclass probability calibration. Binary methods include Platt scaling, temperature scaling, beta calibration, histogram binning, and isotonic regression. Multiclass methods include temperature scaling, vector scaling, Dirichlet calibration, and a one-vs-rest wrapper for the binary calibrators. A calibration-inference layer adds debiased calibration errors, bootstrap confidence intervals, and a kernel calibration hypothesis test for binary and multiclass predictions, including the strong (canonical) multiclass case. Methods follow Platt (1999, ISBN:9780262194488), Zadrozny and Elkan (2002) doi:10.1145/775047.775151, Guo et al. (2017) https://proceedings.mlr.press/v70/guo17a.html, Kull et al. (2017) doi:10.1214/17-EJS1338SI, Kull et al. (2019) doi:10.48550/arXiv.1910.12656, Widmann et al. (2019) doi:10.48550/arXiv.1910.11385, and Kumar et al. (2019) doi:10.48550/arXiv.1909.10155.
- Added a calibration-inference layer for binary and multiclass predictions.
skce()computes the squared kernel calibration error of Widmann et al. (2019) with three estimators: the unbiased U-statistic ("uq"), the unbiased linear-time estimator ("ul"), and the biased V-statistic ("biased"). It supports the binary/confidence reduction, the strong (canonical) multiclass form via a matrix-valued kernel, and the classwise one-vs-rest reduction. In the binary and confidence casesmmce()equalssqrt(skce(..., estimator = "biased")).cal_test()performs a kernel calibration hypothesis test (H0: the model is calibrated). The defaultmethod = "bootstrap"uses the more powerful quadratic estimator with a wild bootstrap (Widmann et al. 2019, Theorem G.2);method = "asymptotic"uses the faster linear-estimator normal test (Lemma 3). It returns an object of classc("cal_test", "htest"). The test targets are binary,"confidence", and the strong"canonical"multiclass form; the classwise average is available only as a point estimate fromskce().cal_ci()returns a percentile bootstrap confidence interval forece(),skce(),mmce(),mce(), orace(), as a classedcal_ciobject with aprint()method.skce()andcal_test()acceptbandwidth = "median"for the median-heuristic kernel scale (Widmann et al. 2019), recommended for the canonical multiclass form; the fixed0.2remains the default.ece()gainsdebiased(the debiased squared-ECE estimator of Kumar, Liang & Ma 2019, Definition 5.2),strategy(equal-width or equal-mass bins, Roelofs et al. 2022), andnorm("l1"or"l2"). Thenormanddebiasedchoices are independent; debiasing is defined only fornorm = "l2". Defaults (norm = "l1",debiased = FALSE,strategy = "width") reproduce the previous numeric output exactly.stratified_folds()(used bycal_cv()) now scopes the optional fold-assignment seed withwithr::local_seed()instead of touching.Random.seeddirectly;withrwas added to Imports. The fold assignments for a givenseedare unchanged.inst/CITATIONnow reads the version from the package metadata, and the package author is also declared as copyright holder inAuthors@R.- The README documents the calibration-inference layer (
skce(),cal_test(),cal_ci(), and thedebiased,strategy, andnormarguments ofece()) with a worked example.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-07-10
Documentation
- Help pages
- 19
- Examples that run
- 100%19 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 84%
Downloads
Repository
8 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/prdm0/probcal on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-07-07
pkgdown site last built 2026-07-02, before release 0.2.0 (2026-07-09)
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-06-23Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: CLAUDE.mdCommits: at least 2 crediting it in the message
- OpenCodefirst seen on or before 2026-06-23Named in .Rbuildignore: .opencodeNamed in .gitignore: .opencode
- Claude Opus 4.82 commits · Jun 2026
Dependencies
Code & Tests
People & History
- 0.2.0Latest2026-07-09 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-07-09
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 1.6 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("probcal")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.