From 648199c4ddc1cceafa68f75bb6ef6dae5a889ce2 Mon Sep 17 00:00:00 2001 From: feiyun0112 Date: Tue, 6 May 2025 22:42:58 +0800 Subject: [PATCH 1/2] set PredictedLabelColumnName --- src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs index 383052e145..2fd9112789 100644 --- a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs +++ b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs @@ -38,6 +38,7 @@ private protected sealed class BindingsImpl : BindingsBase public readonly int ScoreColumnIndex; // The type of the derived column. public readonly DataViewType PredColType; + public readonly string PredictedLabelColumnName; // The ScoreColumnKind metadata value for all score columns. public readonly string ScoreColumnKind; @@ -54,6 +55,7 @@ private BindingsImpl(DataViewSchema input, ISchemaBoundRowMapper mapper, string ScoreColumnIndex = scoreColIndex; ScoreColumnKind = scoreColumnKind; PredColType = predColType; + PredictedLabelColumnName = predictedLabelColumnName; _getScoreColumnKind = GetScoreColumnKind; _getScoreValueKind = GetScoreValueKind; @@ -113,7 +115,7 @@ public BindingsImpl ApplyToSchema(DataViewSchema input, ISchemaBindableMapper bi bool tmp = rowMapper.OutputSchema.TryGetColumnIndex(scoreCol, out mapperScoreColumn); env.Check(tmp, "Mapper doesn't have expected score column"); - return new BindingsImpl(input, rowMapper, Suffix, ScoreColumnKind, true, mapperScoreColumn, PredColType); + return new BindingsImpl(input, rowMapper, Suffix, ScoreColumnKind, true, mapperScoreColumn, PredColType, PredictedLabelColumnName); } public static BindingsImpl Create(ModelLoadContext ctx, DataViewSchema input, From a82504b3cb933c1baa63e73d5ab247243c06667f Mon Sep 17 00:00:00 2001 From: feiyun0112 Date: Wed, 7 May 2025 13:09:26 +0800 Subject: [PATCH 2/2] Update src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs index 2fd9112789..a0be7945d6 100644 --- a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs +++ b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs @@ -38,6 +38,10 @@ private protected sealed class BindingsImpl : BindingsBase public readonly int ScoreColumnIndex; // The type of the derived column. public readonly DataViewType PredColType; + /// + /// The name of the column that contains the predicted labels. + /// This field is used in the scoring process to store or reference the predicted label column. + /// public readonly string PredictedLabelColumnName; // The ScoreColumnKind metadata value for all score columns. public readonly string ScoreColumnKind;