pub struct RegularizationPathResult {
pub lambdas: Array1<Float>,
pub coef_path: Array2<Float>,
pub intercept_path: Array1<Float>,
pub cv_scores: Array1<Float>,
pub cv_scores_std: Array1<Float>,
pub n_nonzero: Array1<usize>,
pub active_features: Vec<Vec<usize>>,
pub best_lambda: Float,
pub best_lambda_idx: usize,
pub lambda_1se: Float,
pub lambda_1se_idx: usize,
}Expand description
Results of regularization path computation
Fields§
§lambdas: Array1<Float>Lambda values used
coef_path: Array2<Float>Coefficient paths (n_lambdas × n_features)
intercept_path: Array1<Float>Intercept paths (n_lambdas)
cv_scores: Array1<Float>Cross-validation scores (n_lambdas)
cv_scores_std: Array1<Float>Standard errors of CV scores (n_lambdas)
n_nonzero: Array1<usize>Number of non-zero coefficients at each lambda
active_features: Vec<Vec<usize>>Indices of selected features at each lambda
best_lambda: FloatBest lambda value (based on CV)
best_lambda_idx: usizeIndex of best lambda
lambda_1se: FloatLambda at 1 standard error rule
lambda_1se_idx: usizeIndex of lambda at 1 standard error rule
Implementations§
Source§impl RegularizationPathResult
impl RegularizationPathResult
Sourcepub fn coef_at_lambda(&self, lambda: Float) -> Option<ArrayView1<'_, Float>>
pub fn coef_at_lambda(&self, lambda: Float) -> Option<ArrayView1<'_, Float>>
Get coefficient at a specific lambda value
Sourcepub fn feature_path(&self, feature_idx: usize) -> Option<ArrayView1<'_, Float>>
pub fn feature_path(&self, feature_idx: usize) -> Option<ArrayView1<'_, Float>>
Get the coefficient path for a specific feature
Sourcepub fn sparse_model_1se(&self) -> (Float, ArrayView1<'_, Float>)
pub fn sparse_model_1se(&self) -> (Float, ArrayView1<'_, Float>)
Find the sparsest model within 1 standard error of the best
Trait Implementations§
Source§impl Clone for RegularizationPathResult
impl Clone for RegularizationPathResult
Source§fn clone(&self) -> RegularizationPathResult
fn clone(&self) -> RegularizationPathResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RegularizationPathResult
impl RefUnwindSafe for RegularizationPathResult
impl Send for RegularizationPathResult
impl Sync for RegularizationPathResult
impl Unpin for RegularizationPathResult
impl UnwindSafe for RegularizationPathResult
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