Skip to content
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ the predicted label is based on the sign of the score.
node = ctx.CreateNode(opType, ctx.GetVariableName(outColumnNames[1]), binarizerOutput, ctx.GetNodeName(opType));
node.AddAttribute("threshold", 0.0);
}

opType = "Cast";
node = ctx.CreateNode(opType, binarizerOutput, ctx.GetVariableName(outColumnNames[0]), ctx.GetNodeName(opType), "");
var t = InternalDataKindExtensions.ToInternalDataKind(DataKind.Boolean).ToType();
node.AddAttribute("to", t);
var predictedLabelCol = OutputSchema.GetColumnOrNull(outColumnNames[0]);
node.AddAttribute("to", predictedLabelCol.HasValue ? predictedLabelCol.Value.Type.RawType : typeof(bool));

@yaeldekel yaeldekel Feb 10, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

predictedLabelCol.HasValue [](start = 36, length = 26)

Doesn't it always have a value?
Or, if it doesn't - should we be adding the ONNX node at all? #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have added an Assert to capture that and fixed the next line.


In reply to: 376929923 [](ancestors = 376929923)

}

private protected override IDataTransform ApplyToDataCore(IHostEnvironment env, IDataView newSource)
Expand Down