From 10ed729f56a42e3701bc4c33fe6e9cc1bdcdbe54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 10 Feb 2020 00:33:00 +0100 Subject: Add experiment for number of evaluations. --- .../figures/selection_count/calc_stats.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 sampling_alg_lac2020/figures/selection_count/calc_stats.py (limited to 'sampling_alg_lac2020/figures/selection_count/calc_stats.py') diff --git a/sampling_alg_lac2020/figures/selection_count/calc_stats.py b/sampling_alg_lac2020/figures/selection_count/calc_stats.py new file mode 100755 index 0000000..b192b72 --- /dev/null +++ b/sampling_alg_lac2020/figures/selection_count/calc_stats.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +import sys + +# if len(sys.argv) != 2: +# print("Wrong number of arguments.") +# print("USAGE: ./calc_stats.py ") +# quit() + +files = ["112_count.txt", "16_count.txt", "48_count.txt", "80_count.txt", "sweep_count.txt"] +for input_file in files: + print(input_file) + + f = open(input_file) + X = [int(i) for i in f.readlines()] + + mean = float(sum(X))/len(X) + stddev = float(sum([x**2 for x in X]))/len(X) - mean**2 + + print("{0:.2f}".format(mean) + " " + "{0:.2f}".format(stddev)) -- cgit v1.2.3