#!/bin/bash # /* vim: set filetype=sh : */ -*- sh -*- # Q0: where will the output be stored Safe=${Safe=${HOME}/var/weka} Output=${Output=/srv/bronze/stuff/dj/var/weka} # Q1: where is your data? Data=${Data=${HOME}/var/data/discrete} Progs=${Progs=${HOME}/work/wisp/var/dj/rbst/classifierStrategyTest} # Q2: what data sets will we run? # A2: only those with binary discrete classes; i.e. Datums=${Datums="a2b/breast-cancer a2b/audiology c2d/colic c2d/credit-a c2d/credit-g c2d/diabetes e2i/heart-c e2i/heart-h e2i/ionosphere j2p/kr-vs-kp j2p/mushroom q2s/sick q2s/splice q2s/sonar t2z/vote t2z/weather t2z/vowel"} Learners=${Learners="2 6 10 12 8 4"} # A2': just a couple #Datums=" c2d/diabetes a2b/breast-cancer q2s/sonar t2z/vote " [ -f "$Functions" ] && . $Functions # All right then. Lets go! mkdir -p $Safe # ensure safe place exists Tmp=`mktemp -d` # make a sandbox where only you will play trap "rm -rf $Tmp" 0 1 2 3 15 # leave nothing behind when you quit cd $Tmp # go to the sandbox main() { set -x echo "Results were: " > $Safe/results.out for datum in $Datums do for learner in $Learners do for((i=1; i<=35; i++)) do $Progs/nbcdtree$learner Mode=1 $Data/$datum.arff Mode=2 $Data/$datum.arff > $Output/$datum.$learner.v2.$i.out $Progs/getAcc $Output/$datum.$learner.v2.$i.out >> $Output/results.out done; done;done;} Log=$$ (main | tee $Safe/xval.$Log ) 2> $Safe/xval.err.$Log echo $Safe/xval.$Log