diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-12-03 23:10:30 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-12-03 23:10:30 -0500 |
| commit | 4375265f87f9a3188982ed15424a109797ea4f51 (patch) | |
| tree | 530e31088cdf5498f1c21a2d0eac3b07da0ef97a /simulation | |
| parent | 8c9ed15024e08560908e40db1aa0e8b058a1efca (diff) | |
| download | cascades-4375265f87f9a3188982ed15424a109797ea4f51.tar.gz | |
adding plot for poster
Diffstat (limited to 'simulation')
| -rw-r--r-- | simulation/plot_utils.py | 48 | ||||
| -rw-r--r-- | simulation/plots/finale.png | bin | 0 -> 45728 bytes |
2 files changed, 36 insertions, 12 deletions
diff --git a/simulation/plot_utils.py b/simulation/plot_utils.py index af5269c..9472707 100644 --- a/simulation/plot_utils.py +++ b/simulation/plot_utils.py @@ -1,4 +1,6 @@ +import numpy as np import matplotlib.pyplot as plt +import matplotlib import argparse import json import seaborn @@ -11,16 +13,38 @@ parser.add_argument('f', help='list of logs to parse', nargs='+') parser.add_argument('-dest', help='name of figure to save', default='fig.png') args = parser.parse_args() -for file_name in args.f: - x, y = [], [] - with open(file_name) as f: - for line in f: - jason = json.loads(line) - x.append(jason[args.x]) - y.append(jason[args.y]) - plt.plot(x, y, label=file_name) -plt.legend() -plt.xlabel(args.x) -plt.ylabel(args.y) -plt.savefig(args.dest) +def default(): + for file_name in args.f: + x, y = [], [] + with open(file_name) as f: + for line in f: + jason = json.loads(line) + x.append(jason[args.x]) + y.append(jason[args.y]) + plt.plot(x, y, label=file_name) + + plt.legend() + plt.xlabel(args.x) + plt.ylabel(args.y) + plt.savefig(args.dest) + +def tmp_finale(): + plt.clf() + for file_name in args.f: + x, y = [], [] + with open(file_name) as f: + for index, line in zip(range(15), f): + assert index <= 15 + jason = json.loads(line) + x.append(jason[args.x]) + y.append(np.sqrt(jason[args.y])) + plt.plot(x, y, label=file_name) + + plt.legend(fontsize=15) + plt.xlabel(r"Nbr of Batches (size $100$)", fontsize=15) + plt.ylabel(r"RMSE", fontsize=15) + plt.savefig(args.dest) + +if __name__ == "__main__": + tmp_finale() diff --git a/simulation/plots/finale.png b/simulation/plots/finale.png Binary files differnew file mode 100644 index 0000000..59378f9 --- /dev/null +++ b/simulation/plots/finale.png |
