GithubHelp home page GithubHelp logo

hrayrhar / regain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fdtomasi/regain

0.0 2.0 0.0 37.84 MB

REGAIN (Regularised Graphical Inference)

License: BSD 3-Clause "New" or "Revised" License

Shell 0.07% Jupyter Notebook 80.23% TeX 0.16% Python 18.02% MATLAB 1.52% Batchfile 0.01%

regain's Introduction

develstat covdevel licence PyPI Conda Python27 Python34 Requirements Status

regain

Regularised graph inference across multiple time stamps, considering the influence of latent variables. It inherits functionalities from the scikit-learn package.

Getting started

Dependencies

REGAIN requires:

  • Python (>= 2.7 or >= 3.5)
  • NumPy (>= 1.8.2)
  • scikit-learn (>= 0.17)

You can install (required) dependencies by running:

pip install -r requirements.txt

To use the parameter selection via gaussian process optimisation, skopt is required.

Installation

The simplest way to install regain is using pip

pip install regain

or conda

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.

git clone https://github.com/fdtomasi/regain.git
cd regain
python setup.py develop

Quickstart

A simple example for how to use LTGL.

import numpy as np
from regain.covariance import LatentTimeGraphicalLasso
from regain.datasets import make_dataset
from regain.utils import error_norm_time

np.random.seed(42)
data = make_dataset(n_dim_lat=1, n_dim_obs=10)
X = data.data
theta = data.thetas

mdl = LatentTimeGraphicalLasso(max_iter=50).fit(X)
print("Error: %.2f" % error_norm_time(theta, mdl.precision_))

Note that the input of LatentTimeGraphicalLasso 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 LatentTimeGraphicalLasso, or, alternatively, use LatentGraphicalLasso.

Citation

REGAIN appeared in the following two publications. For the LatentTimeGraphicalLasso please use

@inproceedings{Tomasi:2018:LVT:3219819.3220121,
 author = {Tomasi, Federico and Tozzo, Veronica and Salzo, Saverio and Verri, Alessandro},
 title = {Latent Variable Time-varying Network Inference},
 booktitle = {Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery \&\#38; Data Mining},
 series = {KDD '18},
 year = {2018},
 isbn = {978-1-4503-5552-0},
 location = {London, United Kingdom},
 pages = {2338--2346},
 numpages = {9},
 url = {http://doi.acm.org/10.1145/3219819.3220121},
 doi = {10.1145/3219819.3220121},
 acmid = {3220121},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {convex optimization, graphical models, latent variables, network inference, time-series},
} 

and for the TimeGraphicalLassoForwardBackward plase use

@InProceedings{pmlr-v72-tomasi18a,
  title = 	 {Forward-Backward Splitting for Time-Varying Graphical Models},
  author = 	 {Tomasi, Federico and Tozzo, Veronica and Verri, Alessandro and Salzo, Saverio},
  booktitle = 	 {Proceedings of the Ninth International Conference on Probabilistic Graphical Models},
  pages = 	 {475--486},
  year = 	 {2018},
  editor = 	 {Kratochv\'{i}l, V\'{a}clav and Studen\'{y}, Milan},
  volume = 	 {72},
  series = 	 {Proceedings of Machine Learning Research},
  address = 	 {Prague, Czech Republic},
  month = 	 {11--14 Sep},
  publisher = 	 {PMLR},
  pdf = 	 {http://proceedings.mlr.press/v72/tomasi18a/tomasi18a.pdf},
  url = 	 {http://proceedings.mlr.press/v72/tomasi18a.html},
  abstract = 	 {Gaussian graphical models have received much attention in the last years, due to their flexibility and expression power. However, the optimisation of such complex models suffer from computational issues both in terms of convergence rates and memory requirements. Here, we present a forward-backward splitting (FBS) procedure for Gaussian graphical modelling of multivariate time-series which relies on recent theoretical studies ensuring convergence under mild assumptions. Our experiments show that a FBS-based implementation achieves, with very fast convergence rates, optimal results with respect to ground truth and standard methods for dynamical network inference. Optimisation algorithms which are usually exploited for network inference suffer from drawbacks when considering large sets of unknowns. Particularly for increasing data sets and model complexity, we argue for the use of fast and theoretically sound optimisation algorithms to be significant to the graphical modelling community.}
}

regain's People

Contributors

fdtomasi avatar veronicatozzo avatar samuelefiorini avatar

Watchers

James Cloos avatar Hrayr Harutyunyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.