pub struct CrossValidationReport {
pub folds: Vec<FoldResult>,
pub metric: SelectionMetric,
/* private fields */
}Expand description
Every fold’s model and performance, and which is best.
Fields§
§folds: Vec<FoldResult>Each fold’s result, in fold order
metric: SelectionMetricThe measure the best fold was picked by
Implementations§
Source§impl CrossValidationReport
impl CrossValidationReport
Sourcepub fn new(folds: Vec<FoldResult>, metric: SelectionMetric) -> Result<Self>
pub fn new(folds: Vec<FoldResult>, metric: SelectionMetric) -> Result<Self>
Collect the fold results and pick the best by metric on the held-out data, breaking
ties by AUC (or by F1 when AUC is the metric).
A fold whose score is NaN, such as precision when nothing was predicted malicious,
counts as worse than any other.
§Errors
Returns an error if there are no folds.
Sourcepub fn best(&self) -> &FoldResult
pub fn best(&self) -> &FoldResult
The best fold.
Sourcepub fn into_best(self) -> LogisticRegression
pub fn into_best(self) -> LogisticRegression
Take the best fold’s model, discarding the others.
Sourcepub fn mean_std(&self, metric: SelectionMetric) -> (f32, f32)
pub fn mean_std(&self, metric: SelectionMetric) -> (f32, f32)
Mean and sample standard deviation of a metric on the held-out folds.
Folds scoring NaN are left out.
Trait Implementations§
Source§impl Clone for CrossValidationReport
impl Clone for CrossValidationReport
Source§impl Debug for CrossValidationReport
impl Debug for CrossValidationReport
Auto Trait Implementations§
impl Freeze for CrossValidationReport
impl RefUnwindSafe for CrossValidationReport
impl Send for CrossValidationReport
impl Sync for CrossValidationReport
impl Unpin for CrossValidationReport
impl UnsafeUnpin for CrossValidationReport
impl UnwindSafe for CrossValidationReport
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more