pub struct PrecisionRecallCurve { /* private fields */ }Expand description
A single precision–recall curve as a drawable series (coordinate space
(f64, f64) = (recall, precision)).
Implementations§
Source§impl PrecisionRecallCurve
impl PrecisionRecallCurve
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)>,
average_precision: f64,
baseline: f64,
) -> Self
pub fn from_points( points: Vec<(f64, f64)>, average_precision: f64, baseline: f64, ) -> Self
Build directly from precomputed (recall, precision) points plus the
average precision and positive-class prevalence baseline.
Sourcepub fn average_precision(&self) -> f64
pub fn average_precision(&self) -> f64
The average precision (area under the PR curve, step definition).
Sourcepub fn baseline_value(&self) -> f64
pub fn baseline_value(&self) -> f64
The positive-class prevalence used as the chance baseline.
Sourcepub fn legend_label(&self, name: &str) -> String
pub fn legend_label(&self, name: &str) -> String
A legend label of the form "{name} (AP = 0.83)". Build before moving
the curve into draw_series.
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.
Sourcepub fn with_baseline(self) -> Self
pub fn with_baseline(self) -> Self
Draw the horizontal prevalence baseline (the PR chance line).
Trait Implementations§
Source§impl Clone for PrecisionRecallCurve
impl Clone for PrecisionRecallCurve
Source§fn clone(&self) -> PrecisionRecallCurve
fn clone(&self) -> PrecisionRecallCurve
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrecisionRecallCurve
impl Debug for PrecisionRecallCurve
Source§impl<DB: DrawingBackend> Drawable<DB> for PrecisionRecallCurve
impl<DB: DrawingBackend> Drawable<DB> for PrecisionRecallCurve
Auto Trait Implementations§
impl Freeze for PrecisionRecallCurve
impl RefUnwindSafe for PrecisionRecallCurve
impl Send for PrecisionRecallCurve
impl Sync for PrecisionRecallCurve
impl Unpin for PrecisionRecallCurve
impl UnsafeUnpin for PrecisionRecallCurve
impl UnwindSafe for PrecisionRecallCurve
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