Fix shuffle misalignment#58
Open
basakbahcivanci wants to merge 2 commits into
Open
Conversation
… and splitting Signed-off-by: Basak Bahcivanci <basakbahcivanci@gmail.com>
…essing and splitting Signed-off-by: Basak Bahcivanci <basakbahcivanci@gmail.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.
This pull request fixes an index misalignment bug where the target column in
transformed_model_target_data.csvcould become out of sync with condition_binary(original target) in the metadata after shuffling/splitting.Changes:
autoxai4omics/utils/ml/data_split.pyReset indices after train/test split to ensure targets remain correctly aligned with features and metadata.
autoxai4omics/utils/ml/preprocessing.pyUpdated to preserve index consistency.
autoxai4omics/utils/ml/class_balancing.pyReplaced direct imports (
from numpy import ndarray,from pandas.core.frame import DataFrame) withimport numpy as npand ”import pandas as pddue to error. Improved error messages to show actual received types for easier debugging. Allowed y_train as a pd.Series (for labels).autoxai4omics/omics/tabular.pyAllowed y to be kept as Series with SampleID index.
autoxai4omics/utils/save.pyUpdated to preserve consistent indices
autoxai4omics/models/tabauto/keras_model.py,autoxai4omics/models/tabauto/lgbm_model.py,autoxai4omics/models/tabauto/xgboost_model.pyUpdated model wrappers to correctly handle input/target arrays with consistent indices, preventing downstream Errors and misaligned labels.