aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/make_plots.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/make_plots.py b/src/make_plots.py
index 18864d3..5b9664c 100644
--- a/src/make_plots.py
+++ b/src/make_plots.py
@@ -35,9 +35,13 @@ def watts_strogatz(n_cascades, lbda, passed_function):
G.import_from_file("../datasets/watts_strogatz_500_80_point3.txt")
A = cascade_creation.generate_cascades(G, p_init=.05, n_cascades=n_cascades)
- G_hat = algorithms.recovery_passed_function(G, A,
- passed_function=passed_function,
- floor_cstt=.1, lbda=lbda, n_cascades=1000)
+ if passed_function==algorithms.greedy_prediction:
+ G_hat = algorithms.greedy_prediction(G, A)
+ else:
+ G_hat = algorithms.recovery_passed_function(G, A,
+ passed_function=passed_function,
+ floor_cstt=.1, lbda=lbda, n_cascades=1000)
+ algorithms.correctness_measure(G, G_hat, print_values=True)
def test():
@@ -54,5 +58,5 @@ def test():
if __name__=="__main__":
- watts_strogatz(n_cascades=1000, lbda=.001, passed_function=
- convex_optimization.sparse_recovery)
+ watts_strogatz(n_cascades=2000, lbda=.001, passed_function=
+ algorithms.greedy_prediction)