Repository navigation
fix(datasets): preserve the sample axis when standardizing one row - #585
Open
Hanabi9248 wants to merge 1 commit into
Open
Hanabi9248 wants to merge 1 commit into
Hanabi9248 wants to merge 1 commit into
Conversation
Signed-off-by: Hanabi <317387557+Hanabi9248@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.
standardize_dataset collapses both singleton axes when extracting targets. For a one-row DataFrame with one target, y becomes a scalar and assigning its sample index raises AttributeError. With multiple targets it becomes a Series indexed by target names and assigning the one-row protected index raises a length mismatch.
Limit squeeze to the columns axis. Single-target results remain Series, multiple-target results remain DataFrames, and the sample axis is retained. This does not change target values, weights, column selection or missing-value policy.
Validation on main 3487791, using Python 3.11.16 with real pandas/NumPy/sklearn and complete package initializers (no mocks):
Run: python tests/test_standardize_single_sample.py -v
The full repository, existing dataset suite, online dataset downloads, other Python/pandas versions and Linux were not run. This is independent of legacy BinaryLabelDataset #193 and the OpenMLStore refactor. AI assistance was used for preparation/review; the test results are actual local executions.