Function parsnip::hamming_loss[][src]

pub fn hamming_loss(pred: &[u64], actual: &[u64]) -> f32

The recall of a dataset

Returns the hamming loss which is the percentage of items which are misclassified [0, 1]

Supports macro and weighted averages

use parsnip::hamming_loss;
 
let actual = vec![0, 1, 2, 0, 0];
let pred = vec![0, 2, 1, 0, 1];
 
assert_eq!(hamming_loss(&pred, &actual), 0.6);