pub struct RocCurve { /* private fields */ }Expand description
A single ROC curve as a drawable series (coordinate space (f64, f64) =
(FPR, TPR)).
Implementations§
Source§impl RocCurve
impl RocCurve
Sourcepub fn from_scores(scores: &[f64], labels: &[bool]) -> Result<Self, StatsError>
pub fn from_scores(scores: &[f64], labels: &[bool]) -> Result<Self, StatsError>
Build from raw predicted scores and true binary labels.
Sourcepub fn from_points(points: Vec<(f64, f64)>) -> Self
pub fn from_points(points: Vec<(f64, f64)>) -> Self
Build directly from precomputed (FPR, TPR) points (assumed ascending in
FPR). AUC is computed from them by trapezoidal integration.
Sourcepub fn legend_label(&self, name: &str) -> String
pub fn legend_label(&self, name: &str) -> String
A legend label of the form "{name} (AUC = 0.87)". Build this before
moving the curve into draw_series, since that consumes it.
Sourcepub fn color(self, color: RGBColor) -> Self
pub fn color(self, color: RGBColor) -> Self
Set the line color (also used for the shading and legend key).
Sourcepub fn stroke_width(self, width: u32) -> Self
pub fn stroke_width(self, width: u32) -> Self
Set the line stroke width in pixels.
Sourcepub fn shade_area(self, shade: bool) -> Self
pub fn shade_area(self, shade: bool) -> Self
Fill the area under the curve (AUC shading).
Sourcepub fn with_baseline(self) -> Self
pub fn with_baseline(self) -> Self
Draw the y = x random-chance diagonal. A one-line opt-in, since this
reference line is standard on ROC charts.
Trait Implementations§
Source§impl<DB: DrawingBackend> Drawable<DB> for RocCurve
impl<DB: DrawingBackend> Drawable<DB> for RocCurve
Auto Trait Implementations§
impl Freeze for RocCurve
impl RefUnwindSafe for RocCurve
impl Send for RocCurve
impl Sync for RocCurve
impl Unpin for RocCurve
impl UnsafeUnpin for RocCurve
impl UnwindSafe for RocCurve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
Source§fn into_dyn(self) -> DynElement<'b, DB, Coord>
fn into_dyn(self) -> DynElement<'b, DB, Coord>
Make the conversion