pub struct ConfusionMatrix { /* private fields */ }Expand description
Confusion matrix for multi-class classification.
Implementations§
Source§impl ConfusionMatrix
impl ConfusionMatrix
Sourcepub fn compute(
predictions: &ArrayView<'_, f64, Ix2>,
targets: &ArrayView<'_, f64, Ix2>,
) -> TrainResult<Self>
pub fn compute( predictions: &ArrayView<'_, f64, Ix2>, targets: &ArrayView<'_, f64, Ix2>, ) -> TrainResult<Self>
Sourcepub fn get(&self, true_class: usize, pred_class: usize) -> usize
pub fn get(&self, true_class: usize, pred_class: usize) -> usize
Get value at (true_class, pred_class).
Sourcepub fn precision_per_class(&self) -> Vec<f64>
pub fn precision_per_class(&self) -> Vec<f64>
Compute per-class precision.
Sourcepub fn recall_per_class(&self) -> Vec<f64>
pub fn recall_per_class(&self) -> Vec<f64>
Compute per-class recall.
Sourcepub fn f1_per_class(&self) -> Vec<f64>
pub fn f1_per_class(&self) -> Vec<f64>
Compute per-class F1 scores.
Sourcepub fn total_predictions(&self) -> usize
pub fn total_predictions(&self) -> usize
Get total number of predictions.
Trait Implementations§
Source§impl Clone for ConfusionMatrix
impl Clone for ConfusionMatrix
Source§fn clone(&self) -> ConfusionMatrix
fn clone(&self) -> ConfusionMatrix
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfusionMatrix
impl Debug for ConfusionMatrix
Auto Trait Implementations§
impl Freeze for ConfusionMatrix
impl RefUnwindSafe for ConfusionMatrix
impl Send for ConfusionMatrix
impl Sync for ConfusionMatrix
impl Unpin for ConfusionMatrix
impl UnwindSafe for ConfusionMatrix
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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