Function roc

Source
pub fn roc<T, X, F, I>(data: I, convert_fn: F) -> Option<(Vec<X>, Vec<X>)>
where I: IntoIterator<Item = T>, F: Fn(T) -> (bool, X), X: Float,
Expand description

Computes a ROC curve of a given classifier.

data is a free-form IntoIterator object and convert_fn is a closure that converts each data-point into a pair (ground_truth, prediction).

Returns None if one of the classes is not present or any values are non-finite. Otherwise, returns Some((v_x, v_y)) where v_x are the x-coordinates and v_y are the y-coordinates of the ROC curve.