{{ message }}
Repository navigation
Fix accuracy/f1 scoring the mismatch rate instead of the match rate - #15
Open
shaurya416 wants to merge 1 commit into
Open
shaurya416 wants to merge 1 commit into
shaurya416 wants to merge 1 commit into
Conversation
check_currentmetric mapped a correct generation to 0 and a wrong one to 1 and then compared against all-1 references, so accuracy and f1 measured the fraction of mismatches. Swap the two values in both execution.py copies.
This file contains hidden or bidirectional Unicode text that may 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.

Fixes #14.
check_currentmetricbuilds the inputs for theaccuracyandf1metrics asand passes them to
metrics/accuracyandmetrics/f1.accuracy_score(references, predictions)then counts the rows where the prediction is1, which are the rows where the generation did not match. A correct generation scores 0 and a wrong or empty one scores 1.This swaps the two values, so a match is
1. The change is the same one line incodefuseEval/execution.pyand incodefuseEval_202503/execution.py. Thef1value keeps its existing formula (F1 of the positive class with all-1 references); only its polarity changes.Verification
The repo has no Python tests, so I did not add one. I extracted
check_currentmetricverbatim from each file withastand ran it against the repo's ownmetrics/accuracy/accuracy.pyandmetrics/f1/f1.pywith real scikit-learn 1.4.2.evaluateanddatasetsare small stand-ins (only theMetricbase class and a docstring decorator). Each row is a set of 10 generations checked against the reference"x":codefuseEval_202503has nometrics/folder in this repository, so I ran itscheck_currentmetric(byte-identical to the other copy) against themetrics/folder fromcodefuseEval; the results are the same as above.