#! /bin/bash # Variables Filename=$1 SortColumn=$2 #ByCorr="1" #ByVariance="2" #ByEntropy="3" #SortColumn=$ByCorr Horizon="0" Subset="-" Path="/tmp/effort" rm -r $Path mkdir $Path RankingFile="/tmp/attr_iteration.dat" rm -r $RankingFile EMstart="1" EMend="15" Subset="-" NewMMRE="99999" # Create Subsets #cp data/coc81modeTypeLangType.csv data/subsets/coc81_all.csv # Preprocess data files #Filename="data/subsets/coc81_all.csv" ConvertedFile=$Filename".converted" SeedFile=$Filename".seed" #gawk -f convertCSV.awk Method="COC81" Style="precise" $Filename > $ConvertedFile # Rank Attributes #echo "Ranking "$Filename "..." ./attr_iteration $Filename COC81 precise $SeedFile coc81:all attrLC $Subset $Path $EMstart $EMend > $RankingFile # Try Combinations of Effort Multipliers # Sort by Correlation #echo "---------------------------------------" #echo "----------Attribute Rankings:----------" #echo "---------------------------------------" #echo "Column, Correlation, Variance, Entropy" #echo "---------------------------------------" sort +$SortColumn -n -r $RankingFile > "/tmp/sort_results.dat" #cat "/tmp/sort_results.dat" #echo "" #echo "---------------------------------------" #echo "--------Attribute Combinations:--------" #echo "---------------------------------------" #echo "Mmre, Sd, Pred30, Columns" #echo "---------------------------------------" i=$EMstart #while [ $i -le $EMend ] while ((i<=EMend)) do #Subset+=$(gawk -v x=$i 'NR==x{print $1}' "/tmp/sort_results.dat") NewSubset=$Subset$(gawk -v x=$i 'NR==x{print $1}' "/tmp/sort_results.dat") # Try Local Calibration using the Subset. #./effort $Filename COC81 precise $SeedFile".pass2" coc81:all simpleLC $Subset $Path #EffortResult=$(./effort $Filename COC81 precise $SeedFile".pass2" coc81:all simpleLC $Subset $Path) EffortResult=$(./effort $Filename COC81 precise $SeedFile".pass2" coc81:all simpleLC $NewSubset $Path) #echo $EffortResult OldMMRE=$NewMMRE NewMMRE=$(echo $EffortResult | gawk '{print $1}') #echo "New MMRE is " $NewMMRE # Test new MMRE and handle Subset Selection #if [ $NewMMRE -l $OldMMRE ] #if ((NewMMRE < OldMMRE)) Keep=$(gawk -v a=$NewMMRE -v b=$OldMMRE 'BEGIN{if (a