#!/bin/bash # $1 - Location of the directory of directories of the data files. ( ../Data/arffData/discrete/ ) # $2 - Location of the Tar3 and Which learners ( ../Src/ ) # $3 - The sample rate of the crossval ( 10 ) # $4 - "i" for equal interval discretization. # "f" for equal frequency discretization. # "n" for no discretization. ( This uses the learners' built in discretization methods ) # $5 - If we are discretizing, this will be the range of numbers to discretize on. # IE "2 4 8 16 32" would mean discretize with 2 bins, 4, bins, etc. # If $4 = n, this should just be 1. # $6 - Location to put just the totals into. cc compare.c -o com; cc plotsort.c -o plotsort; cc sumOfDiff.c -o sumOfDiff; cc sortSod.c -o sortSod; ## Create the directory to put the sum of difference tables into. sodDir=./sodData/; echo "Sum of Diff Directory = $sodDir"; #mkdir $sodDir; ## For each bin number for d in $5 do ## Convert and discretize this data with $d bins. dir=../Data/whichData/discrete/$d"binsEq"$4; echo "Data Directory = $dir"; #mkdir $dir; #./converter $1 $dir $4 $d ## Run Dave Owen's Tar3 Configuration script on the data file. ## This will allow us to make sure Tar3 is optimal. #./cfgsim.sh $dir/$stem $2/t3 > nowhere; #rm -f nowhere; ## Cross-validate the data. ## Create 10 train-test sets and run each through the learner. resDir=results/discrete/$d"binsEq"$4/; echo "Results Directory = $resDir"; mkdir $resDir; ./xval $dir $resDir $2 $3; ## Plot the data generated by the $3 runs with $d bins ## Create a directory to put the plots into. plotDir=./plotData/discrete/$d"binsEq"$4; echo "Plot directory = $plotDir"; mkdir $plotDir; ./genplots $resDir $plotDir/; ## Using the files in $resDir, create a win/loss table for each one. echo "Tallying Sum Of Differences for $d bins"; ./sumOfDiff `ls $resDir/*` $sodDir/discrete/$d"binsEq"$4; ## Sort the sumOfDiff table by which's wins. #./sortSod $sodDir/$d"binsEq"$4 "$d Bin Totals:" $6; done