Skip to content

Commit 415937d

Browse files
committed
Artidoro's comments
1 parent 74090d6 commit 415937d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ public static string GetConfusionTableAsFormattedString(IHost host, IDataView co
13591359
var confusionMatrix = GetConfusionMatrix(host, confusionDataView, binary, sample, false);
13601360
var confusionTableString = GetConfusionTableAsString(confusionMatrix, false);
13611361

1362-
// if there is a Weight column, return the weighted confusionMatrix as well, from this function.
1362+
// If there is a Weight column, return the weighted confusionMatrix as well, from this function.
13631363
if (isWeighted)
13641364
{
13651365
confusionMatrix = GetConfusionMatrix(host, confusionDataView, binary, sample, true);

src/Microsoft.ML.Data/Evaluators/Metrics/ConfusionMatrix.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@ public sealed class ConfusionMatrix
2626
public IReadOnlyList<double> PerClassRecall { get; }
2727

2828
/// <summary>
29-
/// The confsion matrix counts for the combinations actual class/predicted class.
30-
/// The actual classes are in the rows of the table, and the predicted classes in the columns.
29+
/// The confusion matrix counts for the combinations actual class/predicted class.
30+
/// The actual classes are in the rows of the table (stored in the outer <see cref="IReadOnlyList{T}"/>), and the predicted classes
31+
/// in the columns(stored in the inner <see cref="IReadOnlyList{T}"/>).
3132
/// </summary>
3233
public IReadOnlyList<IReadOnlyList<double>> Counts { get; }
3334

3435
/// <summary>
3536
/// The indicators of the predicted classes.
3637
/// It might be the classes names, or just indices of the predicted classes, if the name mapping is missing.
3738
/// </summary>
38-
public int NumberOfPredictedClasses { get; }
39+
public int NumberOfClasses { get; }
3940

4041
/// <summary>
4142
/// The indicators of the predicted classes.
@@ -83,10 +84,10 @@ internal ConfusionMatrix(IHost host, double[] precision, double[] recall, double
8384
IsBinary = isBinary;
8485
PredictedClassesIndicators = labelNames.AsReadOnly();
8586

86-
NumberOfPredictedClasses = confusionTableCounts.Length;
87-
List<IReadOnlyList<double>> counts = new List<IReadOnlyList<double>>(NumberOfPredictedClasses);
87+
NumberOfClasses = confusionTableCounts.Length;
88+
List<IReadOnlyList<double>> counts = new List<IReadOnlyList<double>>(NumberOfClasses);
8889

89-
for (int i = 0; i < NumberOfPredictedClasses; i++)
90+
for (int i = 0; i < NumberOfClasses; i++)
9091
counts.Add(confusionTableCounts[i].ToList().AsReadOnly());
9192

9293
Counts = counts.AsReadOnly();

0 commit comments

Comments
 (0)