diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-01 16:33:04 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-01 16:33:04 -0500 |
| commit | e8369874088c0ae4b1d98f79f5bae3319de2ac6d (patch) | |
| tree | 1ab49efbcdab69a7eaad354bb869883b769ab9c9 /src/make_plots.py | |
| parent | 0991a13214af4023259465f132f09e6c66f3895c (diff) | |
| download | cascades-e8369874088c0ae4b1d98f79f5bae3319de2ac6d.tar.gz | |
updating code to Python 3
Diffstat (limited to 'src/make_plots.py')
| -rw-r--r-- | src/make_plots.py | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/make_plots.py b/src/make_plots.py index 1951576..5aab683 100644 --- a/src/make_plots.py +++ b/src/make_plots.py @@ -6,32 +6,6 @@ import algorithms 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 compare_greedy_and_lagrange_cs284r(): """ Compares the performance of the greedy algorithm on the @@ -40,7 +14,7 @@ def compare_greedy_and_lagrange_cs284r(): """ G = cascade_creation.InfluenceGraph(max_proba = .8) G.import_from_file("../datasets/subset_facebook_SNAPnormalize.txt") - A = cascade_creation.generate_cascades(G, p_init=.05, n_cascades=2000) + A = cascade_creation.generate_cascades(G, p_init=.05, n_cascades=100) #Greedy G_hat = algorithms.greedy_prediction(G, A) @@ -57,9 +31,6 @@ def test(): """ unit test """ - if 0: - plot_rip_numberofnodes(max_proba=.3, n_min=30, n_max=30, - p_init=.01, n_cascades=100, K_max=4) if 1: compare_greedy_and_lagrange_cs284r() |
