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.py60
1 files changed, 56 insertions, 4 deletions
diff --git a/src/make_plots.py b/src/make_plots.py
index d83eb2c..792e325 100644
--- a/src/make_plots.py
+++ b/src/make_plots.py
@@ -108,6 +108,58 @@ def plot_barabasi_albert_graph():
+def plot_kronecker_l2norm():
+ plt.clf()
+ fig = plt.figure(1)
+ x = [50, 100, 500, 1000, 2000]
+ sparse_recov = [62, 60, 36, 28, 21]
+ max_likel = [139, 101, 42, 31, 25]
+ lasso = [50, 48, 33, 29, 23]
+
+ fig, ax = plt.subplots()
+
+ plt.subplots_adjust(bottom=.2, top=.85)
+ plt.xticks(ha="right", rotation=45)
+
+ plt.axis((50, 2000, 0, 145))
+ plt.xlabel("Number of Cascades")
+ plt.ylabel("l2-norm")
+ plt.grid(color="lightgrey")
+ ax.plot(x, lasso, 'ko-', color="orange", label="Lasso")
+ ax.plot(x, max_likel, 'ko-', color="cornflowerblue", label="MLE")
+ ax.plot(x, sparse_recov, 'ko-', color="k", label="Our Method")
+ plt.legend(loc="upper right")
+ ax.set_xticks(x)
+ ax.set_xticklabels(tuple(x))
+ plt.savefig("../paper/figures/"+"kronecker_l2_norm.pdf")
+
+
+def plot_kronecker_l2norm_nonsparse():
+ plt.clf()
+ fig = plt.figure(1)
+ x = [50, 100, 500, 1000, 2000]
+ sparse_recov = [56, 55, 28, 21, 15]
+ max_likel = [125, 80, 35, 25, 20]
+ lasso = [47, 47, 27, 22, 17]
+
+ fig, ax = plt.subplots()
+
+ plt.subplots_adjust(bottom=.2, top=.85)
+ plt.xticks(ha="right", rotation=45)
+
+ plt.axis((50, 2000, 0, 145))
+ plt.xlabel("Number of Cascades")
+ plt.ylabel("l2-norm")
+ plt.grid(color="lightgrey")
+ ax.plot(x, lasso, 'ko-', color="orange", label="Lasso")
+ ax.plot(x, max_likel, 'ko-', color="cornflowerblue", label="MLE")
+ ax.plot(x, sparse_recov, 'ko-', color="k", label="Our Method")
+ plt.legend(loc="upper right")
+ ax.set_xticks(x)
+ ax.set_xticklabels(tuple(x))
+ plt.savefig("../paper/figures/"+"kronecker_l2_norm_nonsparse.pdf")
+
+
def plot_ROC_curve(figure_name):
"""
plot information in a pretty way
@@ -168,8 +220,8 @@ if __name__=="__main__":
#convex_optimization.type_lasso)
if 1:
compute_graph("../datasets/kronecker_graph_256_cross.txt",
- n_cascades=2000, lbda=0.1, min_proba=.2, max_proba=.7,
+ n_cascades=50, lbda=0., min_proba=.2, max_proba=.7,
passed_function=
- #convex_optimization.sparse_recovery,
- convex_optimization.type_lasso,
- sparse_edges=False) \ No newline at end of file
+ convex_optimization.sparse_recovery,
+ #convex_optimization.type_lasso,
+ sparse_edges=True) \ No newline at end of file