pub struct ClassificationMetrics {
pub loss: f64,
pub accuracy: f64,
pub precision: f64,
pub recall: f64,
pub f1_score: f64,
}
Expand description
Performance metrics for classification models.
This struct contains common evaluation metrics used to assess the performance of classification models, including accuracy, precision, recall, and F1 score.
Fields§
§loss: f64
The loss value (e.g., cross-entropy loss) from the model’s predictions.
accuracy: f64
The accuracy of the model, measured as the proportion of correctly classified instances out of the total instances. Range: [0.0, 1.0], where 1.0 means perfect classification.
precision: f64
The precision of the model, measured as the ratio of true positives to the sum of true positives and false positives. Range: [0.0, 1.0], where 1.0 means no false positives.
recall: f64
The recall (sensitivity) of the model, measured as the ratio of true positives to the sum of true positives and false negatives. Range: [0.0, 1.0], where 1.0 means no false negatives.
f1_score: f64
The F1 score, which is the harmonic mean of precision and recall. Range: [0.0, 1.0], where 1.0 means perfect precision and recall. F1 = 2 * (precision * recall) / (precision + recall)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClassificationMetrics
impl RefUnwindSafe for ClassificationMetrics
impl Send for ClassificationMetrics
impl Sync for ClassificationMetrics
impl Unpin for ClassificationMetrics
impl UnwindSafe for ClassificationMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more