Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(288): ground the two rollup nodes in the mAP structure
Names the two stages rather than describing them: `overall` is detection (unit =
the object, did we find the right things), `aggregate` is extraction (unit = the
leaf, among objects established to be the same object, were the values right).
`match_threshold` is the handoff, and it is really the definition of "the same
object": above it, grading the fields is meaningful; below it, grading them would
be scoring the fields of a different object.

That is the structure of mAP, which this repo already implements for bounding
boxes, and `bbox-map-metrics.md` already documents the same rule for IoU: a
below-threshold detection is a failure at the matching stage, not a source of
per-attribute errors. So both pages now cross-link to it rather than arguing the
point from scratch. It also answers the "is the gating a hole" question by
reference to a standard the audience already accepts.

Cross-links verified to resolve against the `#iou-thresholds` anchor.

1975 passed, ruff clean, mkdocs adds no new warnings.
  • Loading branch information
sromoam committed Sep 4, 2026
commit e9ab48351ada8ffd762d24dc0292378e480ce1cf
9 changes: 7 additions & 2 deletions docs/docs/Advanced/aggregate-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ Note the difference between `overall` and `aggregate`:

### Which node answers which question

`overall` reports **object verdicts**: were these two objects comparable, or was the pairing spurious. `aggregate` reports **leaf detail for the objects that were comparable**. `match_threshold` is the line between the two.
The two nodes are the two stages of the evaluation:

An object scoring below `match_threshold` is classified as a single false discovery and is not descended into. Its leaves are not enumerated, because reporting the parts of an object already rejected as a whole would be scoring something declared not comparable.
- **`overall` is detection.** The unit is the object. Did we find the right things? Five line items paired, none spurious.
- **`aggregate` is extraction.** The unit is the leaf. Among the objects established to be the same object, how many field values were correct? 29 of 30.

`match_threshold` is the handoff, and it is really the definition of "the same object". Above it, the pair is the same thing, so grading its fields is meaningful. Below it, it is not the same thing, so grading its fields would be scoring the fields of a *different* object. Such an object is classified as a single false discovery and is not descended into.

This is the same two-stage structure as mean Average Precision, which Stickler also implements for bounding boxes: an IoU threshold decides whether a detection matched, and only matched pairs are evaluated further. See [Bounding Box mAP Metrics](bbox-map-metrics.md#iou-thresholds), where a below-threshold detection is likewise a failure at the matching stage rather than a source of per-attribute errors. Nobody expects an unmatched detection to contribute attribute-level accuracy, and the reasoning here is identical.

Five line items of six fields each, one field of one item wrong. That item scores 5/6, clears a 0.7 threshold, and is comparable:

Expand Down
10 changes: 6 additions & 4 deletions docs/docs/Guides/Evaluation/understanding-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ The `confusion_matrix` object has four keys:

### `overall` vs `aggregate`

The two nodes answer two different questions, and you generally want both:
The two nodes are the two stages of the evaluation, and you generally want both:

- **`overall`**: were these objects comparable at all? For a list of 5 line items that each paired above `match_threshold`, `tp = 5`.
- **`aggregate`**: among the objects that *were* comparable, how many individual leaves landed? For those same 5 items with 6 fields each, `tp` counts up to 30.
- **`overall` is detection.** The unit is the object. Did we find the right things? For a list of 5 line items that each paired above `match_threshold`, `tp = 5`.
- **`aggregate` is extraction.** The unit is the leaf. Among the objects established to be the same object, how many field values were correct? For those same 5 items with 6 fields each, `tp` counts up to 30.

`match_threshold` is the line between them. An object scoring below it is classified as a single **false discovery**: a spurious non-match, counted once at the item level and not descended into. Leaf detail is not reported for it, because enumerating the parts of an object you have already rejected as a whole would be counting a thing you declared not comparable.
`match_threshold` is the handoff, and it is really the definition of "the same object". Above it, the pair is the same thing, so grading its fields is meaningful. Below it, it is not the same thing, so grading its fields would be scoring the fields of a *different* object. Such an object is classified as a single **false discovery** and is not descended into.

If that split is familiar, it should be: it is the structure of mean Average Precision, which Stickler also implements for bounding boxes. An IoU threshold decides whether a detection matched, and only matched pairs are scored further. See [Bounding Box mAP Metrics](../../Advanced/bbox-map-metrics.md#iou-thresholds).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mAP analogy is the right move, but it is worth a half-sentence on where the objects path stops matching it, because the difference cuts against the reader. bbox-map-metrics.md:191 — quoted in the PR description — has a below-threshold detection count as both FP and FN, so recall falls. Here a rejected pairing is FD only:

five items, one rejected
  recall_with_fd=False   overall tp=4 fd=1 fn=0  R=1.0000
  recall_with_fd=True    overall tp=4 fd=1 fn=0  R=0.8000

So by default the ground-truth item that went unmatched leaves no trace in recall, and overall's recall reads 1.0 on a document with a spurious pairing. A reader who accepts "the reasoning here is identical" will expect recall to drop and it will not. Naming recall_with_fd=True here — it is already a compare_with parameter and the closest thing to the mAP convention — makes the parallel hold and points at the knob.


Two examples make the split concrete.

Expand Down