fix: failed_count is always zero in result analysis#178
Open
WatchTree-19 wants to merge 1 commit into
Open
Conversation
Signed-off-by: WatchTree-19 <119982314+WatchTree-19@users.noreply.github.com>
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.
problem
in
compute_confusion(delphi/log/result_analysis.py),failed_countis computed aslen(df_valid) - total, buttotalis itselflen(df_valid), sofailed_countis always0. as a result the "Average fraction of failed examples" thatlog_resultsprints is always0.0, even when the scorer failed to produce a (parseable) prediction for many examples (those rows are dropped by theprediction.notna()filter earlier in the function).fix
len(df) - totalis the number of rows removed by the.notna()filter, i.e. the examples that failed.test
added
tests/test_log/test_result_analysis.py(pandas-only): builds a frame with 2 NaN predictions (whatclassifier.pystores when generation/parse fails) and assertsfailed_count == 2and fraction0.5. fails on current main (assert 0 == 2), passes with the fix. ruff clean.found by reading the code.