Shrinkage

shrinkage

Shrinkage for Python · python · 0.2.0

Regularized statistical models backed by Rust.

Compose Gaussian or binomial models with complete penalties and explicit solvers. Results own original-scale parameters and convergence diagnostics.

Examples

>>> import shrinkage
>>> from importlib.metadata import version
>>> shrinkage.__version__ == version("shrinkage")
True
>>> import numpy as np
>>> x = np.array([[0.0], [1.0], [2.0]])
>>> fit = shrinkage.Lasso(0.1).fit(x, np.array([1.0, 3.0, 5.0]))
>>> fit.termination
'converged'
>>> fit.predict(x).shape
(3,)