pub struct Confusionmatrix {
pub true_positive: i32,
pub true_negative: i32,
pub false_positive: i32,
pub false_negative: i32,
}
Expand description
Defining a struct to represent a confusion matrix for a classifier
§Variable - details
Below are the variables used in the user defined rust structure Confusionmatrix.
- true_positive - i32 - This denotes the number of true positives.
- true_negative - i32 - This denotes the number of true negatives.
- false_positive - i32 - This denotes the number of false positives.
- false_negative - i32 - This denotes the number of false negatives.
Fields§
§true_positive: i32
§true_negative: i32
§false_positive: i32
§false_negative: i32
Implementations§
Source§impl Confusionmatrix
impl Confusionmatrix
- total(&self) -> i32 : returns the total number of cases as an i32.
- accuracy(&self) -> f32 : returns accuracy of the classifier as an f32.
- precision(&self) -> f32 : returns precision of the classifier as an f32.
- true_poitive_rate(&self) -> f32 : returns true positive rate of the classifier as an f32.
- false_positive_rate(&self) -> f32 : returns false positive rate of the classifier as an f32.
- misclassification_rate(&self) -> f32 : returns misclassification rate of the classifier as an f32.
- specificity(&self) -> f32 : returns specificity of the classifier as an f32.
- prevalance(&self) -> f32 : returns prevalance of the classifier as an f32.
Sourcepub fn true_poitive_rate(&self) -> f32
pub fn true_poitive_rate(&self) -> f32
To find the true positive rate of the model
Sourcepub fn false_positive_rate(&self) -> f32
pub fn false_positive_rate(&self) -> f32
To find the false positive rate of the model
Sourcepub fn misclassification_rate(&self) -> f32
pub fn misclassification_rate(&self) -> f32
To find the misclassification rate of the model
Sourcepub fn specificity(&self) -> f32
pub fn specificity(&self) -> f32
To find the specificity of the model
Sourcepub fn prevalance(&self) -> f32
pub fn prevalance(&self) -> f32
To find the prevalance of the model
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