Repository navigation
docs: correct the mean_score docstring and the [Plain, NoteSM] table row (#249, #338) #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
07af8aa
3aa363c
12135c6
b79f0e8
18c241d
8fe2c03
a8e42a8
e9bf36d
f498854
633ce69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1707,14 +1707,18 @@ class TestTheElementGateJudgesAPairNotAList: | |
| [{'a':1},{'b':2},{'c':3}, Plain('p')] 1.0 0.0 0.75 | ||
| ['x','y','z', Plain('p')] 1.0 0.75 0.75 | ||
| [NoteSM] vs [Note2SM] 1.0 1.0 1.0 | ||
| [Plain, NoteSM] vs [Plain, Note2SM] 1.0 0.5 1.0 | ||
| [Plain, NoteSM] vs [Plain, Note2SM] 1.0 0.0 0.5 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Medium (recall). The corrected bare row (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| same, comparator declared on `f` 1.0 0.5 1.0 | ||
|
|
||
| The string row is the shape the refusal is FOR: one element out of four cannot | ||
| be scored, and the field loses a quarter. The dict row zeroed three elements | ||
| that score 1.0 on their own, in the same list, on `dev`, and here the moment | ||
| the plain model is removed. The last row enforced the cross-class rule that | ||
| #327 is deliberately holding open, so the answer depended on whether an | ||
| unrelated plain model shared the list. | ||
| the plain model is removed. Both `[Plain, NoteSM]` rows enforced the | ||
| cross-class rule that #327 is deliberately holding open (bare: fd=2 under the | ||
| list-wide gate), so the answer depended on whether an unrelated plain model | ||
| shared the list. The bare row's 0.5 now is the refused `Plain` pair | ||
| (`[Plain]` vs `[Plain]` scores 0.0 bare), not that rule, which is why | ||
| `test_two_structured_model_classes_keep_the_declared_gap` uses `Declared`. | ||
| """ | ||
|
|
||
| class Plain(BaseModel): | ||
|
|
@@ -1800,6 +1804,23 @@ def test_two_structured_model_classes_keep_the_declared_gap(self): | |
| assert alone == pytest.approx(1.0) | ||
| assert beside_a_plain_model == pytest.approx(alone) | ||
|
|
||
| def test_the_bare_row_loses_the_refused_plain_pair(self): | ||
| """Pins the bare `[Plain, NoteSM]` row of the table above (#338). | ||
|
|
||
| The row drifted from behaviour once because nothing asserted it. The bare | ||
| 0.5 is the refused `Plain` pair: `[Plain]` alone scores 0.0, and the | ||
| cross-class `NoteA`/`NoteB` pair still scores as a match (tp=1). | ||
| """ | ||
| Bare = self._bare() | ||
| assert self._score(Bare, (self.Plain(sku="p"),)) == pytest.approx(0.0) | ||
| result = Bare(f=[self.Plain(sku="p"), self.NoteA(sku="a")]).compare_with( | ||
| Bare(f=[self.Plain(sku="p"), self.NoteB(sku="a")]), | ||
| include_confusion_matrix=True, | ||
| ) | ||
| node = result["confusion_matrix"]["fields"]["f"]["overall"] | ||
| assert result["field_scores"]["f"] == pytest.approx(0.5) | ||
| assert (node["tp"], node["fd"]) == (1, 1) | ||
|
|
||
| def test_a_plain_model_against_a_structured_model_is_still_a_mismatch(self): | ||
| """The pair `and` would have waved through, which is why the rule reads `or`. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low, optional.
RELEASING.md("What belongs in the changelog") says entries are for changes a user can observe, and "When in doubt, ask whether a user reading the release notes could act on it." This entry corrects a table in the 1.0.0 notes, which is defensible. But the user-facing correction in this PR, themean_scoresentence inbulk-evaluation.mdandunderstanding-results.md(leaves under a list get no score, object nodes inside an element do), has no entry. If one of the two gets an entry, the guide-page correction is the one a user can act on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the guide fix is the one a user can act on. I added an Unreleased Documentation entry for it (#249) and kept the #338 table correction next to it. Fixed in 18c241d.