pub fn class_recall<T: PartialEq>(ground_truth: &[T], predicted: &[T], class: &T) -> f64 {
    let (tp, tp_and_fn) = ground_truth.iter()
        .zip(predicted.iter())
        .fold((0, 0), |(t, g), (gt, pr)| {
              let class_t = gt == class;
              let correct = gt == pr;
              (t + (class_t && correct) as i32, g + class_t as i32)
        });
    (tp as f64) / (tp_and_fn) as f64
}
/// The recall of the predicted vector for the specified class.
The recall of the predicted vector for the specified class.
The recall of the predicted vector for the specified class .
pub fn class_recall<T: PartialEq>(ground_truth: &[T], predicted: &[T], class: &T) -> f64 {
    let (tp, tp_and_fn) = ground_truth.iter()
        .zip(predicted.iter())
        .fold((0, 0), |(t, g), (gt, pr)| {
              let class_t = gt == class;
              let correct = gt == pr;
              (t + (class_t && correct) as i32, g + class_t as i32)
        });
    (tp as f64) / (tp_and_fn) as f64
}
pub fn class_recall < T : PartialEq > ( ground_truth : & [ T ] , predicted : & [ T ] , class : & T ) -> f64 { let ( tp , tp_and_fn ) = ground_truth . iter ( ) . zip ( predicted . iter ( ) ) . fold ( ( 0 , 0 ) , | ( t , g ) , ( gt , pr ) | { let class_t = gt == class ; let correct = gt == pr ; ( t + ( class_t && correct ) as i32 , g + class_t as i32 ) } ) ; ( tp as f64 ) / ( tp_and_fn ) as f64 }
The recall of the predicted vector for the specified class.
The recall of the predicted vector for the specified class .
ground_truth
&[T]
predicted
&[T]
class
&T
ground_truth
&[T]
predicted
&[T]
class
&T