satnogs-wut/wut-compare-all

38 lines
729 B
Plaintext
Raw Normal View History

2020-01-02 20:41:56 -07:00
#!/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
2020-01-02 20:56:16 -07:00
CORRECT=0
INCORRECT=0
2020-01-02 20:41:56 -07:00
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
2020-01-02 20:56:16 -07:00
let CORRECT=$CORRECT+1
2020-01-02 20:41:56 -07:00
else
2020-01-02 20:56:16 -07:00
let INCORRECT=$INCORRECT+1
2020-01-02 20:41:56 -07:00
fi
2020-01-02 20:56:16 -07:00
echo "Correct: $CORRECT Incorrect: $INCORRECT"
2020-01-02 20:41:56 -07:00
done