aboutsummaryrefslogtreecommitdiffstats
path: root/src/make_plots.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/make_plots.py')
-rw-r--r--src/make_plots.py43
1 files changed, 38 insertions, 5 deletions
diff --git a/src/make_plots.py b/src/make_plots.py
index aa77365..9b0fc11 100644
--- a/src/make_plots.py
+++ b/src/make_plots.py
@@ -44,7 +44,7 @@ def compute_graph(graph_name, n_cascades, lbda, passed_function):
algorithms.correctness_measure(G, G_hat, print_values=True)
-def plot_graph(figure_name):
+def plot_watts_strogatz_graph():
"""
plot information in a pretty way
"""
@@ -65,24 +65,57 @@ def plot_graph(figure_name):
plt.grid(color="lightgrey")
ax.plot(x, greedy, 'ko-', color="lightseagreen", label='Greedy')
ax.plot(x, lasso, 'ko-', color="orange", label="Lasso")
- ax.plot(x, max_likel, 'ko-', color="coral", label="MLE")
+ ax.plot(x, max_likel, 'ko-', color="cornflowerblue", label="MLE")
ax.plot(x, sparse_recov, 'ko-', color="k", label="Our Method")
plt.legend(loc="lower right")
ax.set_xticks(x)
ax.set_xticklabels(tuple(labels))
+ plt.savefig("../paper/figures/"+"watts_strogatz.pdf")
+
+
+def plot_ROC_curve(figure_name):
+ """
+ plot information in a pretty way
+ """
+ plt.clf()
+ fig = plt.figure(1)
+ #labels = [0, .00002, .002, .02, .2, .5]
+ x_sparse = [.57, .6, .61, .76, .9]
+ y_sparse = [.41, .4, .37, .16, .03]
+
+ x_lasso = [.55, .56, .66]
+ y_lasso = [.5, .43, .25]
+
+ fig, ax = plt.subplots()
+
+ plt.axis((np.log(45), np.log(5500), 0, 1))
+ plt.xlabel("Number of Cascades")
+ plt.ylabel("F1 score")
+ plt.grid(color="lightgrey")
+ ax.plot(x_lasso, y_lasso, 'ko-', color="orange", label="Lasso")
+ ax.plot(x_sparse, y_sparse, 'ko-', color="k", label="Our Method")
+ plt.legend(loc="lower right")
+ ax.set_xticks(x)
+ ax.set_xticklabels(tuple(labels))
plt.savefig("../paper/figures/"+figure_name)
if __name__=="__main__":
if 0:
compute_graph("../datasets/watts_strogatz_300_30_point3.txt",
- n_cascades=5000, lbda=.002, passed_function=
+ n_cascades=100, lbda=.01, passed_function=
#convex_optimization.sparse_recovery)
#algorithms.greedy_prediction)
- convex_optimization.type_lasso)
- if 1:
+ convex_optimization.sparse_recovery)
+ if 0:
compute_graph("../datasets/powerlaw_200_30_point3.txt",
n_cascades=300, lbda=.002, passed_function=
convex_optimization.sparse_recovery)
#algorithms.greedy_prediction)
+ #convex_optimization.type_lasso)
+ if 1:
+ compute_graph("../datasets/barabasi_albert_300_30.txt",
+ n_cascades=100, lbda=.002, passed_function=
+ convex_optimization.sparse_recovery)
+ #algorithms.greedy_prediction)
#convex_optimization.type_lasso) \ No newline at end of file