regain


Nameregain JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/fdtomasi/regain
SummaryREGAIN (Regularised Graph Inference)
upload_time2018-02-16 13:47:02
maintainer
docs_urlNone
authorFederico Tomasi
requires_python
licenseFreeBSD
keywords graph inference latent variables
VCS
bugtrack_url
requirements codecov nose numpy scipy scikit_learn setuptools six
Travis-CI
coveralls test coverage No coveralls.
            [![develstat](https://travis-ci.org/fdtomasi/regain.svg?branch=master)](https://travis-ci.org/fdtomasi/regain) [![covdevel](http://codecov.io/github/fdtomasi/regain/coverage.svg?branch=master)](http://codecov.io/github/fdtomasi/regain?branch=master) [![licence](https://img.shields.io/badge/licence-BSD-blue.svg)](http://opensource.org/licenses/BSD-3-Clause) [![PyPI](https://img.shields.io/pypi/v/regain.svg)](https://pypi.python.org/pypi/regain) [![Conda](https://img.shields.io/conda/v/fdtomasi/regain.svg)](https://anaconda.org/fdtomasi/regain) [![Python27](https://img.shields.io/badge/python-2.7-blue.svg)](https://badge.fury.io/py/regain) [![Python34](https://img.shields.io/badge/python-3.5-blue.svg)](https://badge.fury.io/py/regain) [![Requirements Status](https://requires.io/github/fdtomasi/regain/requirements.svg?branch=master)](https://requires.io/github/fdtomasi/regain/requirements/?branch=master)

# regain
Regularised graph inference across multiple time stamps, considering the influence of latent variables.
It inherits functionalities from the [scikit-learn](https://github.com/scikit-learn/scikit-learn) package.

## Getting started
### Dependencies
regain requires:
- Python (>= 2.7 or >= 3.5)
- NumPy (>= 1.8.2)
- scikit-learn (>= 0.17)

To use the parameter selection via gaussian process optimisation, [GPyOpt](https://github.com/SheffieldML/GPyOpt) is required.
You can install dependencies by running:
```bash
pip install -r requirements.txt
```

### Installation
The simplest way to install regain is using pip
```bash
pip install regain
```
or `conda`

```bash
conda install -c fdtomasi regain
```

If you'd like to install from source, or want to contribute to the project (e.g. by sending pull requests via github), read on. Clone the repository in GitHub and add it to your $PYTHONPATH.
```bash
git clone https://github.com/fdtomasi/regain.git
cd regain
python setup.py develop
```

## Quickstart
A simple example for how to use LTGL.
```python
import numpy as np
from regain.admm import LatentTimeGraphLasso
from regain.datasets import generate_dataset
from regain.utils import error_norm_time

np.random.seed(42)
data = generate_dataset(mode='l1l2', n_dim_lat=1, n_dim_obs=10)
X = data.data
theta = data.thetas

mdl = LatentTimeGraphLasso(max_iter=50).fit(X)
print("Error: %.2f" % error_norm_time(theta, mdl.precision_))
```
Note that the input of `LatentTimeGraphLasso` is a three-dimensional matrix with shape `(n_times, n_samples, n_dimensions)`.
If you have a single time (`n_times = 1`), ensure a `X = X.reshape(1, *X.shape)` before using `LatentTimeGraphLasso`, or, alternatively, use `LatentGraphLasso`.


## Citation
```latex
@ARTICLE{2018arXiv180203987T,
   author = {{Tomasi}, F. and {Tozzo}, V. and {Salzo}, S. and {Verri}, A.},
    title = "{Latent variable time-varying network inference}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1802.03987},
 primaryClass = "stat.ML",
 keywords = {Statistics - Machine Learning, Computer Science - Learning},
     year = 2018,
    month = feb,
   adsurl = {http://adsabs.harvard.edu/abs/2018arXiv180203987T},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
```



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "graph inference,latent variables", 
    "upload_time": "2018-02-16 13:47:02", 
    "requirements": [
        {
            "name": "codecov", 
            "specs": []
        }, 
        {
            "name": "nose", 
            "specs": []
        }, 
        {
            "name": "numpy", 
            "specs": [
                [
                    ">=", 
                    "1.11"
                ]
            ]
        }, 
        {
            "name": "scipy", 
            "specs": [
                [
                    ">=", 
                    "0.16.1"
                ], 
                [
                    ">=", 
                    "1.0.0"
                ]
            ]
        }, 
        {
            "name": "scikit_learn", 
            "specs": [
                [
                    ">=", 
                    "0.17"
                ]
            ]
        }, 
        {
            "name": "setuptools", 
            "specs": []
        }, 
        {
            "name": "six", 
            "specs": []
        }
    ], 
    "author": "Federico Tomasi", 
    "home_page": "https://github.com/fdtomasi/regain", 
    "github_user": "fdtomasi", 
    "download_url": "https://pypi.python.org/packages/de/d3/4b33ecbb3351c04216875df1f9b2afb5b6425f28f089dc23f82192b3c572/regain-0.0.7.tar.gz", 
    "platform": "", 
    "version": "0.0.7", 
    "cheesecake_documentation_id": null, 
    "description": "[![develstat](https://travis-ci.org/fdtomasi/regain.svg?branch=master)](https://travis-ci.org/fdtomasi/regain) [![covdevel](http://codecov.io/github/fdtomasi/regain/coverage.svg?branch=master)](http://codecov.io/github/fdtomasi/regain?branch=master) [![licence](https://img.shields.io/badge/licence-BSD-blue.svg)](http://opensource.org/licenses/BSD-3-Clause) [![PyPI](https://img.shields.io/pypi/v/regain.svg)](https://pypi.python.org/pypi/regain) [![Conda](https://img.shields.io/conda/v/fdtomasi/regain.svg)](https://anaconda.org/fdtomasi/regain) [![Python27](https://img.shields.io/badge/python-2.7-blue.svg)](https://badge.fury.io/py/regain) [![Python34](https://img.shields.io/badge/python-3.5-blue.svg)](https://badge.fury.io/py/regain) [![Requirements Status](https://requires.io/github/fdtomasi/regain/requirements.svg?branch=master)](https://requires.io/github/fdtomasi/regain/requirements/?branch=master)\n\n# regain\nRegularised graph inference across multiple time stamps, considering the influence of latent variables.\nIt inherits functionalities from the [scikit-learn](https://github.com/scikit-learn/scikit-learn) package.\n\n## Getting started\n### Dependencies\nregain requires:\n- Python (>= 2.7 or >= 3.5)\n- NumPy (>= 1.8.2)\n- scikit-learn (>= 0.17)\n\nTo use the parameter selection via gaussian process optimisation, [GPyOpt](https://github.com/SheffieldML/GPyOpt) is required.\nYou can install dependencies by running:\n```bash\npip install -r requirements.txt\n```\n\n### Installation\nThe simplest way to install regain is using pip\n```bash\npip install regain\n```\nor `conda`\n\n```bash\nconda install -c fdtomasi regain\n```\n\nIf you'd like to install from source, or want to contribute to the project (e.g. by sending pull requests via github), read on. Clone the repository in GitHub and add it to your $PYTHONPATH.\n```bash\ngit clone https://github.com/fdtomasi/regain.git\ncd regain\npython setup.py develop\n```\n\n## Quickstart\nA simple example for how to use LTGL.\n```python\nimport numpy as np\nfrom regain.admm import LatentTimeGraphLasso\nfrom regain.datasets import generate_dataset\nfrom regain.utils import error_norm_time\n\nnp.random.seed(42)\ndata = generate_dataset(mode='l1l2', n_dim_lat=1, n_dim_obs=10)\nX = data.data\ntheta = data.thetas\n\nmdl = LatentTimeGraphLasso(max_iter=50).fit(X)\nprint(\"Error: %.2f\" % error_norm_time(theta, mdl.precision_))\n```\nNote that the input of `LatentTimeGraphLasso` is a three-dimensional matrix with shape `(n_times, n_samples, n_dimensions)`.\nIf you have a single time (`n_times = 1`), ensure a `X = X.reshape(1, *X.shape)` before using `LatentTimeGraphLasso`, or, alternatively, use `LatentGraphLasso`.\n\n\n## Citation\n```latex\n@ARTICLE{2018arXiv180203987T,\n   author = {{Tomasi}, F. and {Tozzo}, V. and {Salzo}, S. and {Verri}, A.},\n    title = \"{Latent variable time-varying network inference}\",\n  journal = {ArXiv e-prints},\narchivePrefix = \"arXiv\",\n   eprint = {1802.03987},\n primaryClass = \"stat.ML\",\n keywords = {Statistics - Machine Learning, Computer Science - Learning},\n     year = 2018,\n    month = feb,\n   adsurl = {http://adsabs.harvard.edu/abs/2018arXiv180203987T},\n  adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n}\n```\n\n\n", 
    "lcname": "regain", 
    "bugtrack_url": null, 
    "github": true, 
    "coveralls": false, 
    "name": "regain", 
    "license": "FreeBSD", 
    "travis_ci": true, 
    "github_project": "regain", 
    "summary": "REGAIN (Regularised Graph Inference)", 
    "split_keywords": [
        "graph inference", 
        "latent variables"
    ], 
    "author_email": "federico.tomasi@dibris.unige.it", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-02-16T13:47:00", 
            "comment_text": "", 
            "python_version": "py2.py3", 
            "url": "https://pypi.python.org/packages/4f/4d/b42a6ca970768bad35b29999a9b188a442693e7c965a68eccf1459270692/regain-0.0.7-py2.py3-none-any.whl", 
            "md5_digest": "fac30db976ba34a2bbd57d19aca238a0", 
            "downloads": 0, 
            "filename": "regain-0.0.7-py2.py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "4f/4d/b42a6ca970768bad35b29999a9b188a442693e7c965a68eccf1459270692/regain-0.0.7-py2.py3-none-any.whl", 
            "size": 52427
        }, 
        {
            "has_sig": false, 
            "upload_time": "2018-02-16T13:47:02", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/de/d3/4b33ecbb3351c04216875df1f9b2afb5b6425f28f089dc23f82192b3c572/regain-0.0.7.tar.gz", 
            "md5_digest": "7fefda92e6440a9b84fe3ee51acbe9de", 
            "downloads": 0, 
            "filename": "regain-0.0.7.tar.gz", 
            "packagetype": "sdist", 
            "path": "de/d3/4b33ecbb3351c04216875df1f9b2afb5b6425f28f089dc23f82192b3c572/regain-0.0.7.tar.gz", 
            "size": 33352
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}