#!/bin/bash # /* vim: set filetype=sh : */ # -*- sh -*- #Initialize SELECTed features to nil #This is done by not creating the array until it is time to use it declare -i i=0 declare -i classes=2 declare -i j=0 declare -i runs=31 #DataStems=${DataStems="agaricus-lepiota anneal audiology.standardized auto-mpg balance-scale breast-cancer breast-cancer-wisconsin bridges-v1 bridges-v2 bupa crx echocardiogram ecoli flag glass hayes-roth hepatitis house-votes-84 imports-85 ionosphere iris letter-recognition wdbc wine yeast zoo"} #DataStems=${DataStems="agaricus-lepiota "} #DataStems=${DataStems="anneal "} #DataStems=${DataStems="audiology-standardized "} #DataStems=${DataStems="auto-mpg "} #DataStems=${DataStems="balance-scale "} #DataStems=${DataStems="breast-cancer "} #DataStems=${DataStems="breast-cancer-wisconsin "} #DataStems=${DataStems="bridges-v1 "} #DataStems=${DataStems="bridges-v2 "} #DataStems=${DataStems="bupa "} #DataStems=${DataStems="crx "} #DataStems=${DataStems="ecoli "} #DataStems=${DataStems="flag "} #DataStems=${DataStems="glass "} #DataStems=${DataStems="hayes-roth "} #DataStems=${DataStems="hepatitis "} #DataStems=${DataStems="house-votes-84 "} #DataStems=${DataStems="imports-85 "} #DataStems=${DataStems="ionosphere "} #DataStems=${DataStems="iris "} #DataStems=${DataStems="letter-recognition "} #DataStems=${DataStems="wdbc "} #DataStems=${DataStems="wine "} #DataStems=${DataStems="yeast "} #DataStems=${DataStems="zoo "} DataStems=${DataStems="echocardiogram "} for stem in $DataStems do allTreatments="" treatments="" Selected="" ./arfftoSelectTar $stem.arff #obtain # of classes and store to classes classes=`./grabClasses $stem.names` echo "Running Select on $stem" while [ $j -lt $runs ]; do while [ $i -lt $classes ]; do #run Tar3 on current class, pipe to an output file tar3 $stem > tar3.out #To store the individual TAR3 treatments, #uncomment the following line: #cat tar3.out > $stem.$j.$i.out #parse output file to receive attributes used #store received attributes to selected features list oldtreatments=$treatments treatments=`./getNBestTreatments tar3.out` if [ -n "$oldtreatments" ] ; then treatments=$treatments","$oldtreatments fi #Rotate the Best Class cp $stem.names $stem.old.names ./rotateClasses $stem.old.names > $stem.names #increment counter let i=$i+1 done; rm $stem.old.names rm tar3.out #Examine results of treatments and pick out the unique attributes export treatments treatments=`./trimTreatments ` #echo $treatments #To see the results of trimming the treatments #down to their unique parts, uncomment the following line: #echo "The trimmed treatments were: $treatments" allTreatments=$treatments","$allTreatments let i=0 treatments="" oldtreatments="" let j=$j+1 done; export allTreatments export runs #Count attributes selected and determine which ones occur #in a two-thirds majority of the treatments Selected=`./SelectTreatment` echo "We selected attributes: $Selected from dataset $stem" export Selected ./trimArff $stem".arff" j=0 done; #Do Column Removal based on attributes in SELECTed features list #Run Crossval on original and pruned datasets,