Skip to content

ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default #7458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025

Conversation

feiyun0112
Copy link
Contributor

fix #7452

@Copilot Copilot AI review requested due to automatic review settings May 6, 2025 14:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.99%. Comparing base (f6221d5) to head (a82504b).
Report is 2 commits behind head on main.

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     
Flag Coverage Δ
Debug 68.99% <100.00%> (-0.01%) ⬇️
production 63.27% <100.00%> (-0.01%) ⬇️
test 89.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rosoft.ML.Data/Scorers/PredictedLabelScorerBase.cs 82.02% <100.00%> (+0.06%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@michaelgsharp michaelgsharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for the fix!

@michaelgsharp michaelgsharp merged commit cb802e2 into dotnet:main May 9, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default
2 participants