#! /bin/bash Path=$1 Filename=$2 #Output looks like: #FILENAME,I,TIME,LEARNER,SUBSET,ESTIMATE,ACTUAL,MRE RankingFile=$Path"/attribute_ranking.tmp" ConvertedFile=$Path"/data/"$Filename".numeric" Iterations=$(gawk 'END{print NR}' $ConvertedFile) 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" DoCocomost=1 DoCocomin=1 for ((i=1;i<=$Iterations;i++)) do TestFile=$Path"/data/test/"$Filename".numeric."$i TrainFile=$Path"/data/train/"$Filename".numeric."$i gawk -f separate.awk -v Target=$i -v TrainFile=$TrainFile -v TestFile=$TestFile $ConvertedFile # basic Local Calibration StartTime=$(./seconds) LogFile=$Path"/log/"$Filename".LC."$i echo -n $Filename","$i",LC," Result=$(./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile "-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" $LogFile) EndTime=$(./seconds) ((SpentTime=EndTime-StartTime)) echo -n $SpentTime"," echo $Result if (($DoCocomost==1)) then StartTime=$(./seconds) TargetEMs=$(./lcFssFilter $TrainFile) LogFile=$Path"/log/"$Filename".cocomost."$i echo -n $Filename","$i",cocomost," Result=$(./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile $TargetEMs $LogFile) EndTime=$(./seconds) ((SpentTime=EndTime-StartTime)) echo -n $SpentTime"," echo $Result fi if (($DoCocomin==1)) then StartTime=$(./seconds) # Rank the Attributes RankingFile=$Path"/ranking/"$i".ranking" LogFile=$Path"/log/"$Filename".AttrRanking."$i ./attr_ranking $ConvertedFile $Path "attrLC" $TrainFile $TrainFile "-" $LogFile> $RankingFile # Try Local Calibration using the Best Evaluated Subset of Attributes Learner="cocomin" for Search in $SearchSet do for Horizon in $HorizonSet do for Ranker in $RankerSet do for Eval in $EvalSet do 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"," TargetEMs=$(./attr $ConvertedFile $Path $Ranker $TrainFile $LogFile $Horizon $RankingFile $SortFile $Eval $Search) Result=$(./effort $ConvertedFile $Path "BasicLC" $TestFile $TrainFile $TargetEMs $LogFile".final") EndTime=$(./seconds) ((SpentTime=EndTime-StartTime)) echo -n $SpentTime"," echo $Result done done done done fi done