Shrinkage

shrinkage.ChainFusedLasso

Shrinkage for Python · python · 0.2.0

ChainFusedLasso(
    l1: float,
    fusion: float,
    *,
    weights: npt.ArrayLike | None = None
)

L1 plus weighted fusion of adjacent coefficients in feature order.

The penalty is ``l1 * sum(abs(beta)) + fusion * sum(weights * abs(diff(beta)))``. Strengths and weights must be finite and nonnegative. weights=None uses unit weights; explicit weights must have length max(n_features - 1, 0). Zero weights cut the chain. Weight sequences are copied into an immutable tuple. The intercept is excluded.

l1

l1: float

fusion

fusion: float

weights

weights: tuple[float, ...] | None

__init__

__init__(
    l1: float,
    fusion: float,
    *,
    weights: npt.ArrayLike | None = None
) -> None