Struct juice::solver::confusion_matrix::ConfusionMatrix
source · pub struct ConfusionMatrix { /* private fields */ }
Expand description
Implementations§
source§impl ConfusionMatrix
impl ConfusionMatrix
sourcepub fn new(num_classes: usize) -> ConfusionMatrix
pub fn new(num_classes: usize) -> ConfusionMatrix
Create a ConfusionMatrix that analyzes the prediction of num_classes
classes.
sourcepub fn add_sample(&mut self, prediction: usize, target: usize)
pub fn add_sample(&mut self, prediction: usize, target: usize)
Add a sample by providing the expected target
class and the prediction
.
sourcepub fn add_samples(&mut self, predictions: &[usize], targets: &[usize])
pub fn add_samples(&mut self, predictions: &[usize], targets: &[usize])
Add a batch of samples.
See add_sample.
sourcepub fn get_predictions(&self, network_out: &mut SharedTensor<f32>) -> Vec<usize>
pub fn get_predictions(&self, network_out: &mut SharedTensor<f32>) -> Vec<usize>
Get the predicted classes from the output of a network.
The prediction for each sample of the batch is found by determining which output value had the smallest loss.
sourcepub fn set_capacity(&mut self, capacity: Option<usize>)
pub fn set_capacity(&mut self, capacity: Option<usize>)
Set the capacity
of the ConfusionMatrix
Trait Implementations§
Auto Trait Implementations§
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