summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-10 09:49:33 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-10 09:49:33 +0100
commit2d7e1007192229b70d52c1f04f7114f984f17002 (patch)
treea817029f91ed56467ee97a4b49cec4637e27b287
parent10ed729f56a42e3701bc4c33fe6e9cc1bdcdbe54 (diff)
Use stdddev instead of variance.
-rw-r--r--sampling_alg_lac2020/LAC-20.tex2
-rwxr-xr-xsampling_alg_lac2020/figures/selection_count/calc_stats.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/sampling_alg_lac2020/LAC-20.tex b/sampling_alg_lac2020/LAC-20.tex
index cbbcb17..47c3d4f 100644
--- a/sampling_alg_lac2020/LAC-20.tex
+++ b/sampling_alg_lac2020/LAC-20.tex
@@ -634,7 +634,7 @@ Without the smart search optimization described at the end of Section \ref{sec:i
experiment & sweep & 16 & 48 & 80 & 112 \\
\hline
mean evaluations & 6.81 & 13.99 & 12.93 & 10.88 & 4.00 \\
-variance evaluations & 6.09 & 0.04 & 2.34 & 0.25 & 0.00 \\
+stddev evaluations & 2.47 & 0.19 & 1.53 & 0.50 & 0.00 \\
\hline
\end{tabular}
\end{table}
diff --git a/sampling_alg_lac2020/figures/selection_count/calc_stats.py b/sampling_alg_lac2020/figures/selection_count/calc_stats.py
index b192b72..9d9ac84 100755
--- a/sampling_alg_lac2020/figures/selection_count/calc_stats.py
+++ b/sampling_alg_lac2020/figures/selection_count/calc_stats.py
@@ -1,5 +1,6 @@
#!/usr/bin/python3
import sys
+import math
# if len(sys.argv) != 2:
# print("Wrong number of arguments.")
@@ -14,6 +15,6 @@ for input_file in files:
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
+ stddev = math.sqrt(float(sum([x**2 for x in X]))/len(X) - mean**2)
print("{0:.2f}".format(mean) + " " + "{0:.2f}".format(stddev))