ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default #7458
Merged
michaelgsharp merged 2 commits intodotnet:mainfrom May 9, 2025
feiyun0112:main
Merged
ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default #7458michaelgsharp merged 2 commits intodotnet:mainfrom feiyun0112:main
michaelgsharp merged 2 commits intodotnet:mainfrom
feiyun0112:main
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses bug #7452 by fixing the incorrect handling of a non-default predicted label column name in the ImageClassificationTrainer scorer. Key changes include:
- Adding a new public field, PredictedLabelColumnName.
- Assigning the new field in the BindingsImpl constructor.
- Propagating the new predictedLabelColumnName parameter in ApplyToSchema.
Comments suppressed due to low confidence (1)
src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs:118
- [nitpick] Consider adding tests to verify that a non-default 'PredictedLabelColumnName' is correctly handled throughout the binding and scoring processes.
return new BindingsImpl(input, rowMapper, Suffix, ScoreColumnKind, true, mapperScoreColumn, PredColType, PredictedLabelColumnName);
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7458 +/- ##
==========================================
- Coverage 68.99% 68.99% -0.01%
==========================================
Files 1482 1482
Lines 273879 273880 +1
Branches 28254 28254
==========================================
- Hits 188965 188955 -10
- Misses 77531 77544 +13
+ Partials 7383 7381 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
michaelgsharp
approved these changes
May 9, 2025
Contributor
michaelgsharp
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the fix!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fix #7452