From 9de35421f25bf45158187daea4ddfedd1c93f3d8 Mon Sep 17 00:00:00 2001 From: jeanpouget-abadie Date: Sun, 7 Dec 2014 12:08:31 -0500 Subject: renaming directory + creating dataset directory --- jpa_test/make_plots.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 jpa_test/make_plots.py (limited to 'jpa_test/make_plots.py') diff --git a/jpa_test/make_plots.py b/jpa_test/make_plots.py deleted file mode 100644 index e3c0d3d..0000000 --- a/jpa_test/make_plots.py +++ /dev/null @@ -1,41 +0,0 @@ -import matplotlib.pyplot as plt -import numpy as np -import cascade_creation -import rip_condition - - -def plot_rip_numberofnodes(max_proba, n_min, n_max, p_init, n_cascades, K_max): - """ - Plots the RIP constant for varying number of nodes (n_max included) - """ - x = np.arange(n_min, n_max+1) - y = [] - - for n_nodes in x: - print n_nodes - G = cascade_creation.InfluenceGraph(max_proba=.3) - G.erdos_init(n=n_nodes, p=.1) #TODO: handle different inits! - cascades = cascade_creation.generate_cascades(G, p_init=p_init, - n_cascades=n_cascades) - M, __ = cascade_creation.icc_matrixvector_for_node(cascades, None) - M = cascade_creation.normalize_matrix(M) - y.append(rip_condition.find_kth_rip_constants(M, 4)) # - - print y - - plt.clf() - plt.plot(x, y) - #plt.show() - - return x, y - - -def test(): - """ - unit test - """ - plot_rip_numberofnodes(max_proba=.3, n_min=30, n_max=30, - p_init=.01, n_cascades=100, K_max=4) - -if __name__=="__main__": - test() -- cgit v1.2.3-70-g09d2