Repository navigation
docs: describe NumericDiff as it works - #252
Open
berce (bercedev) wants to merge 1 commit into
Open
berce (bercedev) wants to merge 1 commit into
berce (bercedev) wants to merge 1 commit into
Conversation
SCORERS.md documented max_diff and relative options that neither implementation reads. Document the actual normalized-difference formula instead, and correct the docstring example (105 vs 100 scores 0.9756, not 0.95). Fixes braintrustdata#251.
This branch has not been deployed
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 #251.
SCORERS.mddocumentedmax_diffandrelativeoptions forNumericDiff, but neither the Python nor the JS scorer reads them, so a caller who sets a tight tolerance silently gets the default score. As the issue notes, they only ever existed in the docs.This takes the docs route: the
NumericDiffsection now describes what both implementations compute,1 - |output - expected| / (|output| + |expected|), with an example whose score matches the code. I also corrected the Python docstring example, which said 105 vs 100 scores 0.95; the scorer returns 0.9756.I checked the numbers in the new text against the real Python
NumericDiff:prettier --check SCORERS.md(3.3.2, the pre-commit version) passes.If you would rather implement the two options than drop them from the docs, I'm happy to rework this into that.