Struct eval_metrics::classification::RocCurve[][src]

pub struct RocCurve<T: Scalar> {
    pub points: Vec<RocPoint<T>>,
    // some fields omitted
}
Expand description

Represents a full roc curve

Fields

points: Vec<RocPoint<T>>

Roc curve points

Implementations

Computes the roc curve from the provided data

Arguments

  • scores - vector of scores
  • labels - vector of labels

Errors

An invalid input error will be returned if either scores or labels are empty or contain a single data point, or if their lengths do not match. An undefined metric error will be returned if scores contain any value that is not finite, if scores are all constant, or if labels are all constant.

Examples

use eval_metrics::classification::RocCurve;
let scores = vec![0.4, 0.7, 0.1, 0.3, 0.9];
let labels = vec![false, true, false, true, true];
let roc = RocCurve::compute(&scores, &labels)?;

Computes AUC from the roc curve

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.