@@ -26,16 +26,17 @@ public sealed class ConfusionMatrix
26
26
public IReadOnlyList < double > PerClassRecall { get ; }
27
27
28
28
/// <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}"/>).
31
32
/// </summary>
32
33
public IReadOnlyList < IReadOnlyList < double > > Counts { get ; }
33
34
34
35
/// <summary>
35
36
/// The indicators of the predicted classes.
36
37
/// It might be the classes names, or just indices of the predicted classes, if the name mapping is missing.
37
38
/// </summary>
38
- public int NumberOfPredictedClasses { get ; }
39
+ public int NumberOfClasses { get ; }
39
40
40
41
/// <summary>
41
42
/// The indicators of the predicted classes.
@@ -83,10 +84,10 @@ internal ConfusionMatrix(IHost host, double[] precision, double[] recall, double
83
84
IsBinary = isBinary ;
84
85
PredictedClassesIndicators = labelNames . AsReadOnly ( ) ;
85
86
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 ) ;
88
89
89
- for ( int i = 0 ; i < NumberOfPredictedClasses ; i ++ )
90
+ for ( int i = 0 ; i < NumberOfClasses ; i ++ )
90
91
counts . Add ( confusionTableCounts [ i ] . ToList ( ) . AsReadOnly ( ) ) ;
91
92
92
93
Counts = counts . AsReadOnly ( ) ;
0 commit comments