X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=graph.sh;fp=graph.sh;h=b54fcf4097c78924c72cac850af0180613bdbd0b;hb=d922ad61d35e9a6996730bec24b16f8bf7bc426c;hp=0000000000000000000000000000000000000000;hpb=3bb118f5a9462d02ff7d99ef28ecc0d7e23529f9;p=folded-ctf.git
diff --git a/graph.sh b/graph.sh
new file mode 100755
index 0000000..b54fcf4
--- /dev/null
+++ b/graph.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+#########################################################################
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the version 3 of the GNU General Public License #
+# as published by the Free Software Foundation. #
+# #
+# This program is distributed in the hope that it will be useful, but #
+# WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see . #
+# #
+# Written and (C) by Francois Fleuret #
+# Contact for comments & bug reports #
+#########################################################################
+
+echo "Parsing the log files"
+
+for p in hb h+b; do
+ grep ^INFO results/${p}-*/log | grep "FALSE_NEGATIVE_RATE\|PER_VGA" | \
+ sed -e "s/[^0-9A-Z_ .]//g" | \
+ awk '{
+ if($2 == "DECIMATED_FALSE_NEGATIVE_RATE") {
+ printf(1-$3)
+ } else {
+ printf(" "$3"\n")
+ }
+ }' | sort -g > /tmp/${p}
+
+done
+
+if [[ ! -s /tmp/hb ]] || [[ ! -s /tmp/h+b ]]; then
+ echo "Not enough data points." >&2
+ exit 1
+fi
+
+######################################################################
+
+echo "Generating the graph per se"
+
+GRAPH_NAME="/tmp/roc.eps"
+
+gnuplot<