Repository navigation
Conversation
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
vawsgit
left a comment
There was a problem hiding this comment.
✅ LGTM!
Checked at 4917fa51 (merge base is dev 0a4820f4, so no rebase is needed). The diff is the 3 docs files only. git diff --stat origin/dev HEAD -- src tests is empty.
The new wording matches the code on dev (src/stickler/structured_object_evaluator/models/confidence/metrics.py):
AUROCMetric.computecallsbinary_roc_auc(is_match, confidence). That is a ranking measure, so "ranks right answers above wrong ones" is accurate.BrierScoreMetricis the mean of(confidence - outcome)², andECEMetricbins by confidence and compares confidence with match rate. Both measure calibration, so pointing readers to them is right.AUROCMetric,BrierScoreMetricandECEMetricare all imported in the page's own example (confidence-metrics.md:126), so the new sentence names classes the reader has already seen.
Measured on dev 0a4820f4 (PYTHONPATH=<dev>/src, inspect.getfile(stickler) pointed at that tree), using the 8 pairs from the PR body (right answers at 0.99/0.98, two wrong at 0.90):
| Metric | Value |
|---|---|
| AUROC | 1.0 |
| Brier | 0.203 |
| ECE | 0.214 |
That is perfect ranking with poor calibration, which is what the new sentence says. When the confidence is higher on the wrong answers, AUROC is 0.0, which matches the new "< 0.5" row.
Other "calibrat" wording. I searched docs/, README.md and src/:
Advanced/README.md:19still says "AUROC-based confidence calibration". #641 (open) rewrites that line to "...correlate with actual accuracy using metrics such as AUROC", so leaving it alone avoids a conflict.- The
Guides/Best-Practiceshits are about calibrating comparator thresholds with SMEs, not about AUROC. Guides/Evaluation/confidence-evaluation.md:63-64uses "calibration error" for Brier and ECE, which is correct.
Issue keyword. Refs #491 is right. Items 2 to 5 of #491 are still on this head: confidence-metrics.md:115, rich-value-pattern.md:94, rich-value-pattern.md:159 plus the "removed in 0.5.0" messages in src/, and the [0.3, 0.4, 0.5, 0.1] box at rich-value-pattern.md:81,89.
Checks.
- The full suite passes on the PR tree: 6751 passed, 13 skipped, 1 xfailed. The PR changes no code, so this only confirms the tree is sound.
- The new AUROC table renders as a 3-row table.
- No CI checks are reported on this head yet.
Optional, not blocking: docs/structured_model_REFACTORING.md:66 reads "AUROC and other calibration metrics". It sits outside the MkDocs site and outside #491's list, but it makes the same claim this PR corrects. It could get a one-word fix here or in a follow-up for #491.
sromoam
left a comment
There was a problem hiding this comment.
Thanks @MaxonT, this is a clean, well-scoped fix. I checked it at 4917fa51: docs only, merges cleanly with dev (ce0f710b), and the numbers below come from this tree (inspect.getfile(stickler) pointed at its src/) and match dev. vawsgit's review covers the rest, so there's just one change, to wording I proposed in #491.
Must fix
-
BrierScoreMetriccan't tell you whether 0.9 means 90% right (docs/docs/Advanced/confidence-metrics.md:176). That half of the sentence is mine, and it's wrong. Brier is the mean squared error between confidence and outcome (metrics.py:107), so it also rewards confidence that separates right answers from wrong ones, and it can prefer a model whose 0.9 is not 90%. Measured on 10 fields each:Fields Brier ECE Fields at 0.9 that are right all at 0.9, 9 right 0.090 0.000 9 of 10 8 right at 0.9, 1 right at 0.7, 1 wrong at 0.1 0.018 0.120 8 of 8 Brier scores the second set five times better, yet there 0.9 means 100%.
ECEMetric's bins (accuracyagainstmean_confidence) answer the question directly. Suggestion inline.
One heads-up: we're not merging anything outside the 1.1.0 milestone until 1.1.0 lands, so this will wait until after that even once it's ready.
|
|
||
| AUROC returns `None` when all predictions match (no negative class) or all fail (no positive class). | ||
|
|
||
| AUROC measures ranking, not calibration. To check whether 0.9 means 90% right, use `BrierScoreMetric` or `ECEMetric`. |
There was a problem hiding this comment.
Must fix 1: point the calibration check at ECE's bins, and say why Brier alone doesn't answer it.
| AUROC measures ranking, not calibration. To check whether 0.9 means 90% right, use `BrierScoreMetric` or `ECEMetric`. | |
| AUROC measures ranking, not calibration. To check whether 0.9 means 90% right, use `ECEMetric` and compare each bin's `accuracy` with its `mean_confidence`. `BrierScoreMetric` also rewards confidence that separates right answers from wrong ones, so a lower Brier score alone does not mean better calibration. |
There was a problem hiding this comment.
Thanks, the suggested wording reads better. Done in f57b5a8: the calibration sentence now points at ECEMetric and compares each bin's accuracy with its mean_confidence, and it says that BrierScoreMetric also rewards separating right answers from wrong ones, so a lower Brier score alone does not mean better calibration. Docs only, no code touched.
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
sromoam
left a comment
There was a problem hiding this comment.
Thanks @MaxonT. The calibration sentence now points at ECE's bins and says why Brier alone doesn't answer the question, so this is ready. I checked f57b5a8 merged with dev (9680269). It's docs only, the merge is clean, the full suite gives 7479 passed, 3 skipped, 1 xfailed, and make -C docs check passes. On that tree, ECEMetric's bins carry accuracy and mean_confidence. Ten fields at 0.9 with 9 right give Brier 0.090 and ECE 0.000. 8 right at 0.9, 1 right at 0.7 and 1 wrong at 0.1 give Brier 0.018 and ECE 0.120. So the new sentence holds.
Smaller
- Optional: a CHANGELOG line. Readers could have taken an AUROC of 0.7 or more as "well calibrated", so a line under
## [Unreleased], in a new### Documentationheading, would fit, as on your other docs PR. For example: "Confidence Metrics no longer calls an AUROC of 0.7 or more well calibrated. AUROC measures whether confidence ranks right answers above wrong ones, and the page now points toECEMetric's bins to check calibration (#491)." - Optional: the two lines you reworded keep their em dashes (
bbox-map-metrics.md:283,rich-value-pattern.md:176). A colon, as the See Also list inrich-value-pattern.mduses, would match the rest of our docs. Fine to leave for a follow-up.
Security Scan ResultsASH Security Scan Report
Scan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies:
Report generated by Automated Security Helper (ASH) at 2026-12-04T22:31:22+00:00 |
The Confidence Metrics page described an AUROC score as calibration, but AUROC only measures how well confidence ranks right answers above wrong ones, so this rewords it and points readers to the Brier and ECE metrics for calibration.
Refs #491 (item 1 only)
The Advanced docs call AUROC "well calibrated" / "inversely calibrated", and four other places in two more pages use "calibration" for the same module. AUROC measures ranking: whether right fields get higher confidence than wrong ones. A model whose confidences all sit between 0.90 and 0.99 can score AUROC 1.0 and still be badly calibrated, and the same page offers
BrierScoreMetricandECEMetric, which are the calibration metrics.Changes (docs only, 3 files, 8 lines added, 6 removed):
Advanced/confidence-metrics.md: the AUROC table now reads "Confidence ranks right answers above wrong ones." (0.7 - 1.0) and "Confidence is higher on errors." (< 0.5), and one sentence follows it: "AUROC measures ranking, not calibration. To check whether 0.9 means 90% right, useBrierScoreMetricorECEMetric."Advanced/rich-value-pattern.md(2 places),Advanced/bbox-map-metrics.md(2 places): "calibration" becomes "confidence quality" / "confidence scoring", as the issue proposes.Advanced/README.mdhas the same word in the Confidence Metrics bullet; docs: improve documentation indexes and API reference #641 already rewrites that line, so I left it alone to avoid a conflict.Left for later, not in this PR: items 2 to 5 of #491. Item 4 needs a maintainer decision. The top-level
README.mdandmodels/README.mdstill say "calibration metrics" for the AUROC, Brier and ECE group as a whole, which is accurate because Brier and ECE are calibration metrics; I did not touch them.What I ran, importing stickler from this checkout (
devat 0a4820f,inspect.getfilepointed at the checkout'ssrc/):AUROCMetric,BrierScoreMetricandECEMetricon 8 pairs with confidences 0.99/0.98 on right fields and 0.90 on two wrong ones gave AUROC 1.0, Brier 0.203, ECE 0.215. Perfect ranking, poor calibration, which is the claim the new sentence makes.ruff check .passes. I did not build the MkDocs site or run the test suite (the docs are not read by a test I know of; in my environment pytest stopped on 5 collection errors for missing optional dependencies, unrelated to these files). NoCHANGELOG.mdentry, since no code or behaviour changed.