Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ private protected sealed class BindingsImpl : BindingsBase
public readonly int ScoreColumnIndex;
// The type of the derived column.
public readonly DataViewType PredColType;
/// <summary>
/// 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.
/// </summary>
public readonly string PredictedLabelColumnName;
// The ScoreColumnKind metadata value for all score columns.
public readonly string ScoreColumnKind;

Expand All @@ -54,6 +59,7 @@ private BindingsImpl(DataViewSchema input, ISchemaBoundRowMapper mapper, string
ScoreColumnIndex = scoreColIndex;
ScoreColumnKind = scoreColumnKind;
PredColType = predColType;
PredictedLabelColumnName = predictedLabelColumnName;

_getScoreColumnKind = GetScoreColumnKind;
_getScoreValueKind = GetScoreValueKind;
Expand Down Expand Up @@ -113,7 +119,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,
Expand Down