#! /bin/bash #this file runs competing learners on the given subset of data Path=$1 Filename=$2 RankingFile=$Path"/attribute_ranking.tmp" SeedFile=$Path"/"$Filename".seed" ConvertedFile=$Path"/data/"$Filename".numeric" Iterations=30 TestSets=10 SearchSet="forward" HorizonSet="0" RankerSet="correlation variance_high variance_low entropy_high entropy_low" EvalSet="mmre sd_mre pred30 correlation" #Run the algorithm many times for ((i=1;i<=$Iterations;i++)) do #Randomize Data TestFile=$Path"/data/test/"$Filename".numeric."$i TrainFile=$Path"/data/train/"$Filename".numeric."$i Seed=$RANDOM gawk -f randomize.awk -v Seed=$Seed -v TestSets=$TestSets -v TrainFile=$TrainFile -v TestFile=$TestFile $ConvertedFile # basic Local Calibration #LogFile=$Path"/log/LC/"$Filename"."$i LogFile=$Path"/log/"$Filename".LC."$i echo -n $Filename","$i",LC,N/A,N/A,N/A,N/A," ./effort $ConvertedFile $Path "simpleLC" $TestFile $TrainFile "-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" $LogFile # Rank the Attributes RankingFile=$Path"/ranking/"$i".ranking" LogFile=$Path"/log/"$Filename".AttrRanking."$i ./attr_ranking $ConvertedFile $Path "attrLC" $TestFile $TrainFile "-" $LogFile> $RankingFile # Try Local Calibration using the Best Evaluated Subset of Attributes Learner="attr" for Search in $SearchSet do for Horizon in $HorizonSet do for Ranker in $RankerSet do for Eval in $EvalSet do #FILENAME,I,LEARNER,SEARCH,HORIZON,RANKER,EVAL,MMRE,SD(MRE),PRED30,CORR,COLUMNS LogFile=$Path"/log/"$Search"_"$Horizon"_"$Ranker"_"$Eval"_"$i"_"$Filename"."$Learner SortFile=$Path"/ranking/sorted/"$Search"_"$Horizon"_"$Ranker"_"$Eval"_"$i"_"$Filename"."$Learner #LogFile=$Path"/log/"$Filename".AttrCorr."$i #SortFile=$Path"/ranking/sorted/"$ranker"."$i echo -n $Filename","$i","$Learner","$Search","$Horizon","$Ranker","$Eval"," ./attr $ConvertedFile $Path $Ranker $TestFile $TrainFile $LogFile $Horizon $RankingFile $SortFile $Eval $Search done done done done # Attribute Ranking by Correlation #echo -n $Filename","$i",AttrByCorr," #LogFile=$Path"/log/"$Filename".AttrCorr."$i #SortingFile=$Path"/ranking/sorted/correlation."$i #./attr $ConvertedFile $Path 2 $TestFile $TrainFile $LogFile "0" $RankingFile $SortingFile # Attribute Ranking by Variance #echo -n $Filename","$i",AttrByStdDev," #LogFile=$Path"/log/"$Filename".AttrStdDev."$i #SortingFile=$Path"/ranking/sorted/deviation."$i #./attr $ConvertedFile $Path 3 $TestFile $TrainFile $LogFile "0" $RankingFile $SortingFile # Attribute Ranking by Entropy #echo -n $Filename","$i",AttrByEntropy," #LogFile=$Path"/log/"$Filename".AttrEntropy."$i #SortingFile=$Path"/ranking/sorted/entropy."$i #./attr $ConvertedFile $Path 4 $TestFile $TrainFile $LogFile "0" $RankingFile $SortingFile echo $Seed >> $SeedFile done