https://github.com/kpj/reggy
Python package for regularized regressions.
https://github.com/kpj/reggy
Last synced: 24 days ago
JSON representation
Python package for regularized regressions.
- Host: GitHub
- URL: https://github.com/kpj/reggy
- Owner: kpj
- License: mit
- Created: 2022-01-20T00:10:27.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-12T19:55:44.000Z (over 2 years ago)
- Last Synced: 2025-02-18T09:37:41.214Z (3 months ago)
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reggy
[](https://pypi.python.org/pypi/reggy)
[](https://github.com/kpj/reggy/actions)Python package for regularized regressions.
Supported regularization terms:
* Ridge
* LASSO
* Network-fusion penalty (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6030897/)## Installation
```bash
$ pip install reggy
```## Usage
A simple example with LASSO regularization:
```python
import reggy
import numpy as npalpha = 0.3
beta = 1.7X = np.random.normal(size=(100, 1))
y = np.random.normal(X * beta + alpha, size=(100, 1))model = reggy.RegReg(X, y, family=reggy.gaussian_family, regularizers=[(0.5, reggy.lasso)])
model.fit()print(model.intercept_, model.coef_)
## [[0.22491232]] [[0.9219889]]
```