Function parsnip::recall[][src]

pub fn recall<T>(
    pred: &[T],
    actual: &[T],
    average: Average
) -> Result<f32, LengthError> where
    T: Eq,
    T: Hash

The recall of a dataset

Returns a float where a 1.0 is a perfectly recalled result set

Supports macro and weighted averages

#[macro_use] extern crate approx; // for approximate equality check
use parsnip::{Average, recall};
let actual = vec![0, 1, 2, 0, 1, 2];
let pred = vec![0, 2, 1, 0, 0, 1];
 
assert_ulps_eq!(recall(&pred, &actual, Average::Macro)?, 0.333333333);