Repository navigation
fix(ask-plan): count invalid plans as zero in macro-F1 - #3001
Open
CalebPiusC wants to merge 1 commit into
Open
CalebPiusC wants to merge 1 commit into
CalebPiusC wants to merge 1 commit into
Conversation
cmd_ask left score as None for plans that were invalid (HTTP 400 on execution or an unusable response) and then averaged only the scored pairs. A run with one perfect plan and one invalid plan reported macro_f1 1.0 instead of 0.5, so invalid plans made the metric look better instead of worse. Average over all pairs and treat None as 0.0. Adds a stdlib unittest that fails before this change (1.0 != 0.5) and passes after it. Refs xerj-org#2075 (item 16).
|
Thanks for this contribution — we'd like to merge it. Before we can, we need a signed Contributor License Agreement from: @CalebPiusC It is a one-time thing per contributor, not per pull request. Read CLA.md, then open a small pull request adding your GitHub username to Once it is merged, comment |
This was referenced Nov 6, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that m
68F7
ay be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2075 (item 16).
What
cmd_askinbenchmarks/ask-plan/scripts/ask_arm.pyleftscoreasNonefor invalid plans and then averaged only the scored pairs, soinvalid plans were dropped from macro-F1. One perfect plan plus one
invalid plan reported 1.0 instead of 0.5.
Change
Average over all pairs and treat
Noneas 0.0 (2 lines inask_arm.py).Adds
test_ask_arm.py, a stdlib unittest with the engine mocked.Before / after
Before the fix:
test_invalid_plan_counts_as_zero ... FAIL
AssertionError: 1.0 != 0.5
After the fix:
Ran 2 tests ... OK
Verified / Assumed / Not-run
Verified (Windows, Python 3.14.5, run locally):
(the two fixture scripts needed PYTHONUTF8=1 on Windows because they
open data files without an encoding; I did not change that here)
Assumed:
Not-run:
AI assistance: I used an AI assistant (Claude) to help write the test
and review the change; I ran all checks myself.
No workflow, results or README changes.