diff options
Diffstat (limited to 'src/make_plots.py')
| -rw-r--r-- | src/make_plots.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/make_plots.py b/src/make_plots.py index cb78034..d28d07e 100644 --- a/src/make_plots.py +++ b/src/make_plots.py @@ -44,6 +44,28 @@ def watts_strogatz(n_cascades, lbda, passed_function): algorithms.correctness_measure(G, G_hat, print_values=True) +def plot_graph(figure_name): + """ + plot information in a pretty way + """ + plt.clf() + x = [100, 500, 1000, 2000, 5000] + greedy = [.15, .4, .63, .82, .92] + lasso = [.30, .46, .65, 0, 0] + max_likel = [.29, .67, .8, .87, .9] + sparse_recov = [.32, .7, .82, .89, 0] + plt.axis((0, 5000, 0, 1)) + plt.xlabel("Number of Cascades") + plt.ylabel("F1 score") + plt.grid(color="lightgrey") + plt.plot(x, greedy, 'ko-', color="lightseagreen", label='Greedy') + plt.plot(x, lasso, 'ko-', color="orange", label="Lasso") + plt.plot(x, max_likel, 'ko-', color="coral", label="MLE") + plt.plot(x, sparse_recov, 'ko-', color="k", label="Sparse MLE") + plt.legend(loc="lower right") + plt.savefig("../paper/figures/"+figure_name) + + if __name__=="__main__": - watts_strogatz(n_cascades=2000, lbda=.002, passed_function= + watts_strogatz(n_cascades=5000, lbda=.002, passed_function= convex_optimization.sparse_recovery)
\ No newline at end of file |
