Commit a5a83127 authored by tpetaja1's avatar tpetaja1
Browse files

readme modification

- also commenting files
parent d9b8f0aa
......@@ -6,6 +6,12 @@ import sys
class DataHandler(object):
# Object for creating inverse covariance matrices
# and covariance matrices from network files,
# creating synthetic data sets,
# writing solver results
""" Initialize attributes """
def __init__(self):
self.inverse_sigmas = []
self.sigmas = []
......@@ -219,6 +225,13 @@ class DataHandler(object):
if __name__ == "__main__" and len(sys.argv) % 2 == 1:
# Input arguments need to be pairwise.
# First item of the pair is the network file.
# Second item of the pair is number of datapoints
# to create from the given network.
# Arbitrary number of pair can be inputted.
dh = DataHandler()
data_counts = []
for i in range(1, len(sys.argv), 2):
......
Time-Varying Graphical Lasso
# Time-Varying Graphical Lasso #
Contains 2 TVGL and 2 GL solvers for network inference,
and a DataHandler to create and maintain data files.
......@@ -8,10 +8,10 @@ The solvers use an ADMM algorithm to solve the problem.
Implemented in Python2.7 with NumPy and multiprocessing.
Based on paper from Hallac et al. (2017)
"Network inference via the Time-Varying Graphical Lasso"
"Network inference via the Time-Varying Graphical Lasso"
https://arxiv.org/abs/1703.01958
1. Contains
## 1. Contains ##
Files:
- BaseGraphicalLasso.py - Parent class for all 4 solvers
- ParallelTVGL.py - TVGL solver using multiprocessing
......@@ -29,9 +29,9 @@ Based on paper from Hallac et al. (2017)
- network_results - Results from non-synthetic data executions
- results - Results from synthetic data executions
2. Run solvers
## 2. Run solvers ##
Run from command line with following options
Run from command line with following arguments
- Parallel TVGL:
1. [data file]
......@@ -39,7 +39,7 @@ Based on paper from Hallac et al. (2017)
3. [Number of blocks to be created]
4. [lambda]
5. [beta]
6. [number of processes to be used]
6. [number of processes to be used]
-if higher than # of blocks, # of processes is reduced to # of blocks
Example:
......@@ -52,14 +52,14 @@ Based on paper from Hallac et al. (2017)
4. [lambda]
5. [beta]
Example:
Example:
$ python SerialTVGL.py synthetic_data/datafile1.csv 2 10 2 4
- Static GL:
1. [data file]
2. [Number of blocks to be created]
3. [lambda]
4. [number of processes to be used]
4. [number of processes to be used]
-if higher than # of blocks, # of processes is reduced to # of blocks
Example:
......@@ -72,12 +72,16 @@ Based on paper from Hallac et al. (2017)
Example:
$ python SingleGL.py synthetic_data/datafile1.csv 2
3. Generate synthetic data
## 3. Generate synthetic data ##
Run from command line with at least one [network file name]-[number of data points] pair.
Arbitrary number of pairs can be inputted.
Run from command line with at least one [network file name] [number of data points] pair as arguments.
The first element of the pair defines the file from where network statistics are to be created.
The second element of the pair defines the number of datapoints to be created from the given network.
$ python DataHandler.py [network file name] [number of data points from network] ...
Given multiple pairs, the datapoints will be appended in the given order to the generated data file.
Arbitrary number of pairs can be inputted.
Example:
$ python DataHandler.py networks/network1.csv 200 networks/network2.csv 200 networks/network1.csv 200
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment