Loading DataHandler.py +13 −0 Changes for DataHandler.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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 = [] Loading Loading @@ -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): Loading README.md +12 −8 Changes for README.md: 12 added lines, 8 removed lines. Original line number Diff line number Diff line 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. Loading @@ -11,7 +11,7 @@ Based on paper from Hallac et al. (2017) "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 Loading @@ -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] Loading Loading @@ -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 Loading
DataHandler.py +13 −0 Changes for DataHandler.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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 = [] Loading Loading @@ -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): Loading
README.md +12 −8 Changes for README.md: 12 added lines, 8 removed lines. Original line number Diff line number Diff line 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. Loading @@ -11,7 +11,7 @@ Based on paper from Hallac et al. (2017) "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 Loading @@ -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] Loading Loading @@ -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