satnogs-wut/wut-compare-all

38 lines
729 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
CORRECT=0
INCORRECT=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 CORRECT=$CORRECT+1
else
let INCORRECT=$INCORRECT+1
fi
echo "Correct: $CORRECT Incorrect: $INCORRECT"
done