Skip to content

Commit 98458ba

Browse files
committed
Fixed undefined rankofCorrectLabel and trailing whitespace warning
1 parent 9259031 commit 98458ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Microsoft.ML.Data/Evaluators/MulticlassClassificationEvaluator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,11 @@ public override void ProcessRow()
491491
var correctProba = !wasKnownLabel ? 0 : _scoresArr[intLabel];
492492

493493
// Find the rank of the *correct* label (in _scoresArr[]). If the correct (ground truth) labels gets rank 0,
494-
// it means the model assigned it the highest probability (that's ideal). Rank 1 would mean our model
494+
// it means the model assigned it the highest probability (that's ideal). Rank 1 would mean our model
495495
// gives the real label the 2nd highest probabality, etc.
496496
// The rank will be from 0 to N. (Not N-1). Rank N is used for unrecognized values.
497497
//
498-
// Tie breaking: What if we have probabilities that are equal to the correct prediction (eg, a:0.1, b:0.1,
498+
// Tie breaking: What if we have probabilities that are equal to the correct prediction (eg, a:0.1, b:0.1,
499499
// c:0.1, d:0.6, e:0.1 where c is the correct label).
500500
// This actually happens a lot with some models. We handle ties by assigning rank in order of first
501501
// appearance. In this example, we assign c the rank of 3, because d has a higher probability and a and b
@@ -512,9 +512,9 @@ public override void ProcessRow()
512512
assigned = i;
513513
}
514514

515-
UnweightedCounters.Update(rankofCorrectLabel, assigned, logloss, intLabel, 1);
515+
UnweightedCounters.Update(rankOfCorrectLabel, assigned, logloss, intLabel, 1);
516516
if (WeightedCounters != null)
517-
WeightedCounters.Update(rankofCorrectLabel, assigned, logloss, intLabel, weight);
517+
WeightedCounters.Update(rankOfCorrectLabel, assigned, logloss, intLabel, weight);
518518
}
519519

520520
protected override List<string> GetWarningsCore()

0 commit comments

Comments
 (0)