Shrinkage

shrinkage::CrossValidationFit

Shrinkage for Rust · rust · 0.3.0

pub struct CrossValidationFit<F, P>

Fold paths, aggregated uncertainty, selected candidate, and full-data refits.

Fold scores are averaged with equal fold weights, even for unequal sizes. For K folds, SE = sqrt(sum((score - mean)^2) / (K * (K - 1))). These conventional fold standard errors do not account for dependence between overlapping training sets. All candidate fits must converge.

Inherent implementation

impl<F, P> CrossValidationFit<F, P>

assignments

pub fn assignments(&self) -> &FoldAssignments

Held-out assignments in original observation order.

fit

pub fn fit(&self) -> &F

Selected fit from the full-data path, with original-scale parameters.

folds

pub fn folds(&self) -> &[FoldPath<F, P>]

Training-fold paths in zero-based fold order.

lambda

pub fn lambda(&self) -> Option<f64>

Selected full-data scalar strength, when the path supplies one.

mean_scores

pub fn mean_scores(&self) -> &[f64]

Equal-weight means of held-out fold losses, aligned with candidates.

metric

pub fn metric(&self) -> ValidationMetric

Family-compatible metric used for validation.

minimum_index

pub fn minimum_index(&self) -> usize

First candidate with minimum mean loss.

one_standard_error_index

pub fn one_standard_error_index(&self) -> usize

First candidate within one standard error of the minimum-loss point.

penalty

pub fn penalty(&self) -> &P

Selected complete full-data penalty, including every strength and weight.

refit_path

pub fn refit_path(&self) -> &PathFit<F, P>

Fresh path fitted on all observations after validation and selection.

relative_strengths

pub fn relative_strengths(&self) -> Option<&[f64]>

Shared automatic fractions of each fold's own starting anchor. Explicit paths have no inferred scalar representation.

selected_index

pub fn selected_index(&self) -> usize

Candidate chosen by the configured rule.

selection_rule

pub fn selection_rule(&self) -> SelectionRule

Rule used to select the full-data fit.

standard_errors

pub fn standard_errors(&self) -> &[f64]

Sample standard deviations of fold losses divided by sqrt(K).

Implementation of Clone

impl<F: core::clone::Clone, P: core::clone::Clone> Clone for CrossValidationFit<F, P>

clone

fn clone(&self) -> Self

Implementation of Debug

impl<F: core::fmt::Debug, P: core::fmt::Debug> Debug for CrossValidationFit<F, P>

fmt

fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result

Implementation of Freeze

impl<F, P> Freeze for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: Freeze, PathFit<F, P>: Freeze

Implementation of RefUnwindSafe

impl<F, P> RefUnwindSafe for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: RefUnwindSafe, PathFit<F, P>: RefUnwindSafe

Implementation of Send

impl<F, P> Send for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: Send, PathFit<F, P>: Send

Implementation of Sync

impl<F, P> Sync for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: Sync, PathFit<F, P>: Sync

Implementation of Unpin

impl<F, P> Unpin for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: Unpin, PathFit<F, P>: Unpin

Implementation of UnsafeUnpin

impl<F, P> UnsafeUnpin for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: UnsafeUnpin, PathFit<F, P>: UnsafeUnpin

Implementation of UnwindSafe

impl<F, P> UnwindSafe for CrossValidationFit<F, P> where Vec<FoldPath<F, P>>: UnwindSafe, PathFit<F, P>: UnwindSafe

Implementation of Any

impl<T> Any for T where T: 'static + ?Sized

Implementation of Borrow

impl<T> Borrow<T> for T where T: ?Sized

Implementation of BorrowMut

impl<T> BorrowMut<T> for T where T: ?Sized

Implementation of ByRef

impl<T> ByRef<T> for T

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized

Implementation of CloneToUninit

impl<T> CloneToUninit for T where T: Clone

Implementation of From

impl<T> From<T> for T

Implementation of Imply

impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized

Implementation of Into

impl<T, U> Into<U> for T where U: From<T>

Implementation of IntoEither

impl<T> IntoEither for T

Implementation of Pointable

impl<T> Pointable for T

Implementation of Read

impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized

Implementation of Same

impl<T> Same for T

Implementation of SupersetOf

impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>

Implementation of ToOwned

impl<T> ToOwned for T where T: Clone

Implementation of TryFrom

impl<T, U> TryFrom<U> for T where U: Into<T>

Implementation of TryInto

impl<T, U> TryInto<U> for T where U: TryFrom<T>