Module path

Module path 

Source
Expand description

Lambda path generation for regularized regression.

This module provides utilities for generating a sequence of lambda values for regularization paths, matching glmnet’s approach.

§Lambda Path Construction

glmnet generates a lambda path from lambda_max down to lambda_min:

  • lambda_max: The smallest lambda for which all penalized coefficients are zero
  • lambda_min: lambda_min_ratio * lambda_max

For pure ridge (alpha=0), lambda_max is theoretically infinite, so we use a small alpha value to compute a finite starting point.

Structs§

LambdaPathOptions
Options for generating a lambda path.

Functions§

compute_lambda_max
Computes lambda_max: the smallest lambda for which all penalized coefficients are zero.
extract_lambdas
Extracts a specific set of lambdas from a path.
make_lambda_path
Generates a lambda path from lambda_max down to lambda_min.