Struct tangram_metrics::ClassMetrics [−][src]
pub struct ClassMetrics { pub true_positives: u64, pub false_positives: u64, pub true_negatives: u64, pub false_negatives: u64, pub accuracy: f32, pub precision: f32, pub recall: f32, pub f1_score: f32, }
Expand description
ClassMetrics are class specific metrics used to evaluate the model’s performance on each individual class.
Fields
true_positives: u64
This is the total number of examples whose label is equal to this class that the model predicted as belonging to this class.
false_positives: u64
This is the total number of examples whose label is not equal to this class that the model predicted as belonging to this class.
true_negatives: u64
This is the total number of examples whose label is not equal to this class that the model predicted as not belonging to this class.
false_negatives: u64
This is the total number of examples whose label is equal to this class that the model predicted as not belonging to this class.
accuracy: f32
The accuracy is the fraction of examples of this class that were correctly classified.
precision: f32
The precision is the fraction of examples the model predicted as belonging to this class whose label is actually equal to this class. precision = true_positives / (true_positives + false_positives)
. See Precision and Recall.
recall: f32
The recall is the fraction of examples in the dataset whose label is equal to this class that the model predicted as equal to this class. recall = true_positives / (true_positives + false_negatives)
.
f1_score: f32
The f1 score is the harmonic mean of the precision and the recall. See F1 Score.