Papers › On the Usefulness of the Fit-on-the-Test View on Evaluating Calibration of Classifiers

On the Usefulness of the Fit-on-the-Test View on Evaluating Calibration of Classifiers

16 Mar 2022arXiv:2203.08958archive 2025-07-28

Markus Kängsepp, Kaspar Valk, Meelis Kull

Every uncalibrated classifier has a corresponding true calibration map that calibrates its confidence. Deviations of this idealistic map from the identity map reveal miscalibration. Such calibration errors can be reduced with many post-hoc calibration methods which fit some family of calibration maps on a validation dataset. In contrast, evaluation of calibration with the expected calibration error (ECE) on the test set does not explicitly involve fitting. However, as we demonstrate, ECE can still be viewed as if fitting a family of functions on the test data. This motivates the fit-on-the-test view on evaluation: first, approximate a calibration map on the test data, and second, quantify its distance from the identity. Exploiting this view allows us to unlock missed opportunities: (1) use the plethora of post-hoc calibration methods for evaluating calibration; (2) tune the number of bins in ECE with cross-validation. Furthermore, we introduce: (3) benchmarking on pseudo-real data where the true calibration map can be estimated very precisely; and (4) novel calibration and evaluation methods using new calibration map families PL and PL3.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2203.08958")

Code

Syntology Ran 2 of 22 code samples harvested from 1 repository linked to this paper; 20 have no recorded run. Of those that ran: 1 ran · violated contract; 1 ran · fixture could not drive it.

By repository: official repository: 22 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

markus93/fit-on-the-test officialmentioned in papertfMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

22 samples harvested; 2 ran; 0 honoured the contract we drafted; 20 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
1ran · fixture could not drive it
20unverified

Licence: 0 of the 22 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from markus93/fit-on-the-test. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

mirror_1d markus93/fit-on-the-test/Experiments_Pseudo/kde.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 8f3819e94710b239 · report
square markus93/fit-on-the-test/Experiments_Pseudo/calibration_functions.py official repository ran · violated contract fingerprinted MIT (permissive) · 83be324d300a4045 · report
binning_n_bins_with_crossvalidation markus93/fit-on-the-test/Experiments_Pseudo/binnings.py official repository unverified MIT (permissive) · 4139ecf4c8942eb3 · report
construct_calibration_fun markus93/fit-on-the-test/Experiments_Pseudo/calibration_function_derivates.py official repository unverified MIT (permissive) · 8f150358dd1a028b · report
construct_correlation_data_row markus93/fit-on-the-test/Experiments_Pseudo/dataframe_helpers.py official repository unverified MIT (permissive) · f669081dc30a1915 · report
construct_data_row markus93/fit-on-the-test/Experiments_Synthetic/run_method.py official repository unverified MIT (permissive) · 0b75185643864e8d · report
construct_data_row_from_binning markus93/fit-on-the-test/Experiments_Synthetic/run_method.py official repository unverified MIT (permissive) · bb7567171178b1d4 · report
construct_data_row_from_binning markus93/fit-on-the-test/Experiments_Pseudo/dataframe_helpers.py official repository unverified MIT (permissive) · 051fb62188a6ca48 · report
construct_data_row_from_raw_data markus93/fit-on-the-test/Experiments_Synthetic/run_method.py official repository unverified MIT (permissive) · debb147433f25086 · report
find_expected_calibration_error markus93/fit-on-the-test/Experiments_Pseudo/calibration_function_derivates.py official repository unverified MIT (permissive) · 55ae28f90999512f · report
find_suitable_fun_amount markus93/fit-on-the-test/Experiments_Pseudo/calibration_function_derivates.py official repository unverified MIT (permissive) · 79d72a8e7def9af5 · report
generate_data markus93/fit-on-the-test/Experiments_Pseudo/data_generation.py official repository unverified MIT (permissive) · 0e19229d023ae722 · report
get_cgts markus93/fit-on-the-test/Experiments_Pseudo/df_unify_5m.py official repository unverified MIT (permissive) · 71335b4eb90f29e0 · report
get_data_name markus93/fit-on-the-test/Experiments_Pseudo/df_unify_5m.py official repository unverified MIT (permissive) · 2d6d5280ab3aec05 · report
get_preds_all markus93/fit-on-the-test/Experiments_Pseudo/cal_methods.py official repository unverified MIT (permissive) · 8302116db328969a · report
get_strs markus93/fit-on-the-test/Experiments_Pseudo/df_unify_5m.py official repository unverified MIT (permissive) · 095a6e6431202e35 · report
log_encode markus93/fit-on-the-test/Experiments_Pseudo/cal_methods.py official repository unverified MIT (permissive) · e742a88077f30c11 · report
poly markus93/fit-on-the-test/Experiments_Pseudo/calibration_functions.py official repository unverified MIT (permissive) · 7f8c2b881b22648e · report
select markus93/fit-on-the-test/Experiments_Pseudo/dataframe_helpers.py official repository unverified MIT (permissive) · 115a8789d9377db2 · report
softmax markus93/fit-on-the-test/Experiments_Pseudo/cal_methods.py official repository unverified MIT (permissive) · 80483261c3f6087d · report
split_data markus93/fit-on-the-test/Experiments_Pseudo/main_NN_1m_final.py official repository unverified MIT (permissive) · 4dc7cd36d2936a07 · report
sqrt markus93/fit-on-the-test/Experiments_Pseudo/calibration_functions.py official repository unverified MIT (permissive) · 645602835255b5f9 · report

Tasks

Benchmarking

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections