#[non_exhaustive]pub struct Metrics {
pub precision: f32,
pub recall: f32,
pub f1_score: f32,
pub predicted_occurrences_count: i32,
pub ground_truth_occurrences_count: i32,
pub predicted_document_count: i32,
pub ground_truth_document_count: i32,
pub true_positives_count: i32,
pub false_positives_count: i32,
pub false_negatives_count: i32,
pub total_documents_count: i32,
/* private fields */
}Expand description
Evaluation metrics, either in aggregate or about a specific entity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.precision: f32The calculated precision.
recall: f32The calculated recall.
f1_score: f32The calculated f1 score.
predicted_occurrences_count: i32The amount of occurrences in predicted documents.
ground_truth_occurrences_count: i32The amount of occurrences in ground truth documents.
predicted_document_count: i32The amount of documents with a predicted occurrence.
ground_truth_document_count: i32The amount of documents with a ground truth occurrence.
true_positives_count: i32The amount of true positives.
false_positives_count: i32The amount of false positives.
false_negatives_count: i32The amount of false negatives.
total_documents_count: i32The amount of documents that had an occurrence of this label.
Implementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
Sourcepub fn set_precision<T: Into<f32>>(self, v: T) -> Self
pub fn set_precision<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_recall<T: Into<f32>>(self, v: T) -> Self
pub fn set_recall<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_f1_score<T: Into<f32>>(self, v: T) -> Self
pub fn set_f1_score<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_predicted_occurrences_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_predicted_occurrences_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of predicted_occurrences_count.
§Example
let x = Metrics::new().set_predicted_occurrences_count(42);Sourcepub fn set_ground_truth_occurrences_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_ground_truth_occurrences_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of ground_truth_occurrences_count.
§Example
let x = Metrics::new().set_ground_truth_occurrences_count(42);Sourcepub fn set_predicted_document_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_predicted_document_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of predicted_document_count.
§Example
let x = Metrics::new().set_predicted_document_count(42);Sourcepub fn set_ground_truth_document_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_ground_truth_document_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of ground_truth_document_count.
§Example
let x = Metrics::new().set_ground_truth_document_count(42);Sourcepub fn set_true_positives_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_true_positives_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of true_positives_count.
§Example
let x = Metrics::new().set_true_positives_count(42);Sourcepub fn set_false_positives_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_false_positives_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of false_positives_count.
§Example
let x = Metrics::new().set_false_positives_count(42);Sourcepub fn set_false_negatives_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_false_negatives_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of false_negatives_count.
§Example
let x = Metrics::new().set_false_negatives_count(42);Sourcepub fn set_total_documents_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_total_documents_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of total_documents_count.
§Example
let x = Metrics::new().set_total_documents_count(42);