wut-compare scripts

master
cv server 2020-01-02 20:41:56 -07:00
parent 0ab498a879
commit 170fd6a131
3 changed files with 62 additions and 0 deletions

View File

@ -28,6 +28,8 @@ Learning/Testing, results are inaccurate.
The following scripts are in the repo:
* `wut` --- Feed it an observation ID and it returns if it is a "good", "bad", or "failed" observation.
* `wut-compare` --- Compare an observation IDs' presumably human vetting with a `wut` vetting.
* `wut-compare-all` --- Compare all the observations in `download/` with `wut` vettings.
* `wut-dl-sort` --- Populate `data/` dir with waterfalls from `download/`.
* `wut-ml` --- Main machine learning Python script using Tensorflow and Keras.
* `wut-obs` --- Download the JSON for an observation ID.

23
wut-compare 100755
View File

@ -0,0 +1,23 @@
#!/bin/bash
# wut-compare
#
# Check the results of a prediction against vetted results
#
# Usage:
# wut-compare [Observation ID]
# Example:
# wut-compare 1468165
#
OBSID="$1"
# Download observation
./wut-water $OBSID
# 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 "Vetted Status: $VET"
# Get Machine Learning Result
./wut $OBSID

37
wut-compare-all 100755
View File

@ -0,0 +1,37 @@
#!/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