Commit 320c6a46 authored by bbguimaraes's avatar bbguimaraes
Browse files

Minor tweaks to scripts.

parent 18b476a9
#!/bin/sh
# Find best result (by percent correct) in a file by dataset.
set -e
set -e
tmp=`getopt -o f: -- "$@"` || exit $?
eval set -- "$tmp"
while true; do
case "$1" in
-f) input_file="$2"; shift 2 ;;
--) shift; break ;;
esac
done
dataset="$1"
if [ "$#" -lt 1 ]; then
echo "Usage: $0 [ -f input_file ] dataset [ sort_options... ]" >&2
usage() {
cat >&2 <<EOF
Usage: $0 dataset
Collects the best results from each file in the set of results file.
EOF
}
if [ "$#" -ne 1 ]; then
usage
exit 1
fi
shift
ordering="${@:--k 13,13n}"
[ "$input_file" ] && exec < "$input_file"
cat \
| grep "^$dataset" \
| sort -t , $ordering \
| tail -1
dataset="$1"
root_dir="$(dirname $0)"
results_dirs="$(find * -maxdepth 0 -type d | sort)"
for result_dir in $results_dirs; do
"${root_dir}/get_best" -f "${result_dir}"/out.csv "${dataset}"
done
#!/bin/sh
usage() {
echo "Usage: $0 [ -f input_file ] dataset [ sort_options... ]" >&2
echo "" >&2
echo "Find best result (by percent correct) in a file by dataset." >&2
}
set -e
tmp=`getopt -o f: -- "$@"` || exit $?
eval set -- "$tmp"
while true; do
case "$1" in
-f) input_file="$2"; shift 2 ;;
--) shift; break ;;
esac
done
dataset="$1"
if [ "$#" -lt 1 ]; then
usage
exit 1
fi
shift
ordering="${@:--k 13,13n}"
[ "$input_file" ] && exec < "$input_file"
cat \
| grep "^$dataset" \
| sort -t , $ordering \
| tail -1
......@@ -2,7 +2,7 @@
# Displays specific columns of a results file.
if [ "$#" -ne 1 ]; then
if [ "$#" -lt 1 ]; then
echo "Usage: $0 file column,column..." >&2
exit 1
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment