#! /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 TestSets=1 #SearchSet="forward backward" SearchSet="forward" #HorizonSet="0 1 2 4 8 16" HorizonSet="16" #RankerSet="correlation variance_high variance_low entropy_high entropy_low" RankerSet="correlation" #EvalSet="mmre sd_mre pred30 correlation" EvalSet="mmre" DoCocomostV2=1 #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 #./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile "-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" $LogFile LogFile=$Path"/log/"$Filename".LC."$i #echo -n $Filename","$i","$Seed",LC,-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-," echo -n $Filename","$i","$Seed",LC," ./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile "-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" $LogFile if (($DoCocomostV2==1)) then TargetEMs=$(./lcFssFilter $TrainFile) LogFile=$Path"/log/"$Filename".cocomostV2."$i #echo -n $Filename","$i","$Seed",cocomostV2,"$TargetEMs"," echo -n $Filename","$i","$Seed",cocomostV2," ./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile $TargetEMs $LogFile fi # Rank the Attributes RankingFile=$Path"/ranking/"$i".ranking" LogFile=$Path"/log/"$Filename".AttrRanking."$i #./attr_ranking $ConvertedFile $Path "attrLC" $TestFile $TrainFile "-" $LogFile> $RankingFile ./attr_ranking $ConvertedFile $Path "attrLC" $TrainFile $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 #echo -n $Filename","$i","$Learner","$Search","$Horizon","$Ranker","$Eval"," echo -n $Filename","$i","$Seed","$Learner"_"$Search"_"$Horizon"_"$Ranker"_"$Eval"," #./attr $ConvertedFile $Path $Ranker $TestFile $TrainFile $LogFile $Horizon $RankingFile $SortFile $Eval $Search TargetEMs=$(./attr $ConvertedFile $Path $Ranker $TrainFile $LogFile $Horizon $RankingFile $SortFile $Eval $Search) ./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile $TargetEMs $LogFile".final" done done done done echo $Seed >> $SeedFile done