Metadata-Version: 2.1
Name: reggy
Version: 0.2.0
Summary: Python package for regularized regressions.
Home-page: https://github.com/kpj/reggy
License: MIT
Author: kpj
Author-email: kim.philipp.jablonski@gmail.com
Requires-Python: >=3.9.0,<3.10.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: pandas (>=1.3.5,<2.0.0)
Requires-Dist: tensorflow (>=2.7.0,<3.0.0)
Requires-Dist: tensorflow-probability (>=0.15.0,<0.16.0)
Project-URL: Repository, https://github.com/kpj/reggy
Description-Content-Type: text/markdown

# reggy

[![PyPI](https://img.shields.io/pypi/v/reggy.svg?style=flat)](https://pypi.python.org/pypi/reggy)
[![Tests](https://github.com/kpj/reggy/workflows/Tests/badge.svg)](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 np


alpha = 0.3
beta = 1.7

X = 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]]
```

