Baltor Get started

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.

Files, names only

  • ATTRIBUTION.md 3.9 KB
  • LICENSE 1.0 KB
  • README.md 3.0 KB
  • atom_cli.py 3.0 KB
  • component.json 14.1 KB
  • multicalibration_audit.py 6.7 KB
  • numerics.py 28.0 KB
  • schema_lite.py 8.9 KB
  • test_multicalibration_audit.py 3.3 KB
  • test_package.py 12.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

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.