diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-02-10 00:33:00 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-02-10 00:33:00 +0100 |
commit | 10ed729f56a42e3701bc4c33fe6e9cc1bdcdbe54 (patch) | |
tree | c8c56009d88958418723030debcdde214c660996 /sampling_alg_lac2020/figures/selection_count/calc_stats.py | |
parent | 7f8a99795f81eb8659e347764295887232d0dc4b (diff) |
Add experiment for number of evaluations.
Diffstat (limited to 'sampling_alg_lac2020/figures/selection_count/calc_stats.py')
-rwxr-xr-x | sampling_alg_lac2020/figures/selection_count/calc_stats.py | 19 |
1 files changed, 19 insertions, 0 deletions
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 <input_file>") +# 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)) |