#! /bin/bash # ./effort $Filename $Path $Learner $TestFile $TrainFile $TargetEMs $LogFile # Arguments Filename=$1 Path=$2 Learner=$3 TestFile=$4 TrainFile=$5 TargetEMs=$6 LogFile=$7 gawk -f basiclc.awk Pass=1 TargetEMs=$TargetEMs $TrainFile Pass=2 TargetEMs=$TargetEMs $TestFile > $LogFile #gawk -f simplelc.awk Pass=1 TargetEMs=$TargetEMs $TrainFile Pass=2 TargetEMs=$TargetEMs $TestFile > $LogFile #./lc81 $TrainFile $TestFile $TargetEMs "F"> $LogFile #Stats=$(./calc $LogFile) #TrainingCount=$(gawk 'END{print NR;}' $TrainFile) if [ $Learner == "attrLC" ] ; then Stats=$(./calc $LogFile) #Calculate Standard Deviation of Attribute AttrDev=$(gawk -f columnstdev.awk Columns=$TargetEMs $Filename) #Calculate Entropy of Attribute (using discrete formula because the effort multipliers are discrete) AttrEntropy=$(gawk -f columnentropy.awk Columns=$TargetEMs $Filename) AvgCorr=$(echo $Stats | gawk 'BEGIN{FS=","} NR==1{print $4}') echo $TargetEMs","$AvgCorr","$AttrDev","$AttrEntropy fi if [ $Learner == "simpleLC" ] ; then Stats=$(./calc $LogFile) echo $Stats","$TargetEMs fi if [ $Learner == "BasicLC" ] ; then echo -n $TargetEMs"," gawk 'BEGIN{FS=",";OFS=",";} NR=1{re=($1-$2)/$2;mre=re<0?-1*re:re;print $1,$2,100*mre}' $LogFile fi