Library / Code module
Multicalibration audit by prediction bin and group
multicalibration_audit
Report the mean residual (outcome minus prediction) in every prediction bin for every declared group and for the whole population, flag cells beyond a tolerance, and repair violations by iterative patching. Finds miscalibration that cancels out in the overall reliability bins.
ATTRIBUTION.md3.9 KBLICENSE1.0 KBREADME.md3.0 KBatom_cli.py3.0 KBcomponent.json14.1 KBmulticalibration_audit.py6.7 KBnumerics.py28.0 KBschema_lite.py8.9 KBtest_multicalibration_audit.py3.3 KBtest_package.py12.0 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Entry points
- multicalibration_audit, multicalibrate
- Known answers
- 6 cases its tests reproduce
Cases it covers
- overall bins hide group errors: An audit of the overall bins sees residual 0 and passes, while each group is off by 0.2 in opposite directions.
Limits and scope
- Limits
- Equal-width bins only; residuals in sparse cells are noisy and no confidence interval is computed. The audit covers only the declared groups, not every computable subgroup. Patching changes predictions on the audit data itself: evaluate the patched predictor on fresh data before trusting it.
- Guarantees
- Each cell's residual is the exact mean of outcome minus prediction over its rows; the implicit group all is always audited. Each patch of a flagged cell lowers the squared error by at least minimum_count x tolerance^2, so multicalibrate stops; on return without hitting max_rounds no cell is flagged. A prediction of exactly 1 joins the last bin.
- Assumes
- Groups are declared in advance; the audit only checks the groups it is given. Cells smaller than minimum_count are reported but never flagged; their residuals are noisy.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/multicalibration_audit
- Size
- 10 files, 84.0 KB
- Identity
library.supply.creative_originals.7bf6c1bf99d5a50a9d870a48.587989e08e0b0bec- Version
587989e08e0b0beca63680d4aa8921a5e0b0ed571957d03300e2826606200189
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- Statistics for comparing resultsDeterministic skills
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.