diff --git a/README.md b/README.md index 9b022e8..c10f40e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/wut-compare b/wut-compare new file mode 100755 index 0000000..d008a21 --- /dev/null +++ b/wut-compare @@ -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 + diff --git a/wut-compare-all b/wut-compare-all new file mode 100755 index 0000000..4606f74 --- /dev/null +++ b/wut-compare-all @@ -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 +