satnogs-wut/wut-compare-all

38 lines
738 B
Bash
Executable File

#!/bin/bash
# wut-compare-all
#
# Check the results of a prediction against vetted results.
# Uses all files in download directory
#
# Usage:
# wut-compare-all
# Example:
# wut-compare-all
#
MAIN_DIR=`pwd`
cd download/ || exit
GOOD_SCORE=0
BAD_SCORE=0
for OBSID in *
do
echo -n "$OBSID "
cd $MAIN_DIR
# Get previous rating
VET=`cat download/$OBSID/$OBSID.json | jq --compact-output '.[0] | {vetted_status}' | cut -f 2 -d ":" | sed -e 's/}//g' -e 's/"//g'`
echo -n "Vet: $VET "
# Get Machine Learning Result
WUT_VET=`./wut $OBSID | cut -f 2 -d " "`
echo -n "Wut: $WUT_VET "
if [ $VET = $WUT_VET ] ; then
let GOOD_SCORE=$GOOD_SCORE+1
else
let BAD_SCORE=$BAD_SCORE+1
fi
echo "SCORE: Good $GOOD_SCORE, Bad $BAD_SCORE"
done