Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 1.14 KB

README.md

File metadata and controls

27 lines (24 loc) · 1.14 KB

Run BigQUIC Graphical LASSO (GLASSO) solver in Python

  1. Install R.
  2. Run this command within R.
install.packages('BigQuic', repos='http://cran.us.r-project.org')
  1. Install rpy2 to call R from python (from the command line). (Also pip install sklearn and numpy if you don't already have them.)
pip install rpy2
  1. Run python py_bigquic.py to test.
  2. An example usage is below.
import numpy as np
import py_bigquic as pbq

data_array = np.random.random((10,20))  # A test data array with 10 samples, 20 variables
alpha = 0.5  # The sparsity hyper parameter
prec = pbq.bigquic(data_array, alpha)  # Returns the precision matrix

I implemented this to do large-scale comparisons on high-dimensional, under-sampled covariance estimation with Linear CorEx. If you are interested in this type of application, I strongly recommend checking Linear CorEx out, as it outperforms GLASSO in many scenarios! Results will be added to this paper: Low Complexity Gaussian Latent Factor Models and a Blessing of Dimensionality.