#! /bin/bash File="log/nfoldCocomostExperimentSep28.csv" #Goals="LC cocomost cocomin_forward_16_correlation_mmre" Goals="LC cocomost cocomin_forward_0_correlation_mmre cocomin_forward_0_correlation_sd_mre cocomin_forward_0_correlation_pred30 cocomin_forward_0_correlation_correlation cocomin_forward_1_correlation_mmre cocomin_forward_1_correlation_sd_mre cocomin_forward_1_correlation_pred30 cocomin_forward_1_correlation_correlation cocomin_forward_2_correlation_mmre cocomin_forward_2_correlation_sd_mre cocomin_forward_2_correlation_pred30 cocomin_forward_2_correlation_correlation cocomin_forward_4_correlation_mmre cocomin_forward_4_correlation_sd_mre cocomin_forward_4_correlation_pred30 cocomin_forward_4_correlation_correlation cocomin_forward_8_correlation_mmre cocomin_forward_8_correlation_sd_mre cocomin_forward_8_correlation_pred30 cocomin_forward_8_correlation_correlation cocomin_forward_16_correlation_mmre cocomin_forward_16_correlation_sd_mre cocomin_forward_16_correlation_pred30 cocomin_forward_16_correlation_correlation cocomin_backward_0_correlation_mmre cocomin_backward_0_correlation_sd_mre cocomin_backward_0_correlation_pred30 cocomin_backward_0_correlation_correlation cocomin_backward_1_correlation_mmre cocomin_backward_1_correlation_sd_mre cocomin_backward_1_correlation_pred30 cocomin_backward_1_correlation_correlation cocomin_backward_2_correlation_mmre cocomin_backward_2_correlation_sd_mre cocomin_backward_2_correlation_pred30 cocomin_backward_2_correlation_correlation cocomin_backward_4_correlation_mmre cocomin_backward_4_correlation_sd_mre cocomin_backward_4_correlation_pred30 cocomin_backward_4_correlation_correlation cocomin_backward_8_correlation_mmre cocomin_backward_8_correlation_sd_mre cocomin_backward_8_correlation_pred30 cocomin_backward_8_correlation_correlation cocomin_backward_16_correlation_mmre cocomin_backward_16_correlation_sd_mre cocomin_backward_16_correlation_pred30 cocomin_backward_16_correlation_correlation" Split=0 if ((Split==0)) then echo "#LEARNER,MMRE,SD(MRE),PRED30,CORR" for goal in $Goals do AvgEstimate=$(grep $goal $File | gawk 'BEGIN{FS=",";} {x+=$6} END{print x/NR}') AvgActual=$(grep $goal $File | gawk 'BEGIN{FS=",";} {x+=$7} END{print x/NR}') echo -n $goal"," grep $goal $File | gawk 'BEGIN{FS=OFS=","}{print $6,$7}' | gawk -f calc.awk AvgEstimate=$AvgEstimate AvgActual=$AvgActual done exit fi echo "#LEARNER,MMRE,SD(MRE),PRED30,CORR" Datasets="coc81 nasa93" for data in $Datasets do echo $data for goal in $Goals do AvgEstimate=$(grep $goal $File | grep $data | gawk 'BEGIN{FS=",";} {x+=$6} END{print x/NR}') AvgActual=$(grep $goal $File | grep $data | gawk 'BEGIN{FS=",";} {x+=$7} END{print x/NR}') echo -n $goal"," grep $goal $File | grep $data | gawk 'BEGIN{FS=OFS=","}{print $6,$7}' | gawk -f calc.awk AvgEstimate=$AvgEstimate AvgActual=$AvgActual done done