Shrinkage

shrinkage.PathOptions

Shrinkage for Python · python · 0.2.0

PathOptions(
    *,
    nlambda: int = 100,
    lambda_min_ratio: float | None = None,
    lambda_start: float | None = None,
    early_stopping: bool = True,
    min_points: int = 5,
    deviance_change_tolerance: float = 1e-5,
    deviance_ratio_tolerance: float = 0.999
)

Generate a decreasing log-spaced sequence on the optimization scale.

nlambda and min_points must be positive. The endpoint ratio is in (0, 1] and defaults to 0.01 when samples are fewer than features, or 0.0001 otherwise. lambda_start overrides the anchor without changing the reported true zero threshold. A zero anchor gives all zeros.

Early stopping requires converged points and at least min_points fits. The change tolerance is finite and nonnegative; zero disables that check. The explained null-deviance tolerance is in (0, 1]. Disable early stopping to fit every requested point. Options are validated when fitting.

nlambda

nlambda: int = field(default=100, kw_only=True)

lambda_min_ratio

lambda_min_ratio: float | None = field(default=None, kw_only=True)

lambda_start

lambda_start: float | None = field(default=None, kw_only=True)

early_stopping

early_stopping: bool = field(default=True, kw_only=True)

min_points

min_points: int = field(default=5, kw_only=True)

deviance_change_tolerance

deviance_change_tolerance: float = field(default=1e-5, kw_only=True)

deviance_ratio_tolerance

deviance_ratio_tolerance: float = field(default=0.999, kw_only=True)