# shrinkage

Shrinkage for Python · 0.2.0

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/packages/python/src/shrinkage/__init__.py>)

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.

<a id="examples"></a>

## Examples

```python
>>> 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,)
```
