Skip to content

ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default - #7458

Merged
michaelgsharp merged 2 commits into
dotnet:mainfrom
feiyun0112:main
May 9, 2025
Merged

michaelgsharp merged 2 commits into
dotnet:mainfrom
feiyun0112:main

Conversation

@feiyun0112

Copy link
Copy Markdown
Contributor

fix #7452

Copilot AI review requested due to automatic review settings May 6, 2025 14:46
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Pull requests submitted by community contributors label May 6, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented May 6, 2025 •

Copy link
Copy Markdown

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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@michaelgsharp michaelgsharp left a comment

Copy link
Copy Markdown
Contributor

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
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community-contribution Pull requests submitted by community contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default

3 participants