Repository navigation
FIX: Reject non-binary objective labels in CSV datasets - #3414
Open
Jacqueline122 wants to merge 1 commit into
Open
Jacqueline122 wants to merge 1 commit into
Jacqueline122 wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
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.
Description
Fixes #3413.
The OBJECTIVE CSV loader previously converted human labels using bool(int(score)) without validating their original values. This silently changed labels such as 2 and -1 to True, and 0.9 to False.
This change validates every human-score column before conversion and raises a ValueError identifying the column when a label is outside 0/1.
Valid integer, float, and boolean representations of 0/1 remain supported. HARM dataset scoring is unchanged.
OpenAI Codex assisted with reproduction, implementation, regression tests, and local validation.
Tests and Documentation
Added 14 regression cases covering:
Before the fix, the new tests report 8 failures and 6 passes. After the fix, all 107 tests in test_human_labeled_dataset.py pass, including the 93 existing tests.
The targeted test module was run with --noconftest, bypassing database-wide fixtures. Ruff lint, formatting, and git diff checks pass. The full repository suite was not run.
Updated the CSV validation method's docstring. JupyText was not run; no notebooks were changed.