#!/bin/bash Here=$1 Sandbox=$2 Repeats=$3 Use=$4 Pred=$5 Learners=$6 Log=$7 let Min=(Use+10) generate(){ ./csv2arff --ranges rules.config --relation "center2" nasa93_center_2.csv > center2.arff ./csv2arff --ranges rules.config --relation "center5" nasa93_center_5.csv > center5.arff for((R=1;R<=Repeats;R++)) do ./blab "$R " Seed=$RANDOM ./interIntraArffs Seed=$Seed TestSize=$Use center2.arff center5.arff ./cocNums --numbers precise.config trainCenter2Inter.arff > trainCenter2InterN.arff ./cocNums --numbers precise.config trainCenter2Intra.arff > trainCenter2IntraN.arff ./cocNums --numbers precise.config testCenter2.arff > testCenter2N.arff ./cocNums --numbers precise.config trainCenter5Inter.arff > trainCenter5InterN.arff ./cocNums --numbers precise.config trainCenter5Intra.arff > trainCenter5IntraN.arff ./cocNums --numbers precise.config testCenter5.arff > testCenter5N.arff #---------- No Wrapper WRAPPER="None" for Learner in $Learners do Prefix="$R,$WRAPPER,${Learner},center2,inter"; . $Sandbox/$Learner trainCenter2InterN.arff testCenter2N.arff; Prefix="$R,$WRAPPER,${Learner},center2,intra"; . $Sandbox/$Learner trainCenter2IntraN.arff testCenter2N.arff; Prefix="$R,$WRAPPER,${Learner},center5,inter"; . $Sandbox/$Learner trainCenter5InterN.arff testCenter5N.arff; Prefix="$R,$WRAPPER,${Learner},center5,intra"; . $Sandbox/$Learner trainCenter5IntraN.arff testCenter5N.arff; done #---------- COCOMIN Wrapper WRAPPER="COCOMINWrapper" gawk 'BEGIN {FS=OFS=","} /@/ {next} NF>0 {print $0}' trainCenter2InterN.arff > COCOMINWrapper_TrainCenter2Inter; gawk 'BEGIN {FS=OFS=","} /@/ {next} NF>0 {print $0}' trainCenter2IntraN.arff > COCOMINWrapper_TrainCenter2Intra; gawk 'BEGIN {FS=OFS=","} /@/ {next} NF>0 {print $0}' trainCenter5InterN.arff > COCOMINWrapper_TrainCenter5Inter; gawk 'BEGIN {FS=OFS=","} /@/ {next} NF>0 {print $0}' trainCenter5IntraN.arff > COCOMINWrapper_TrainCenter5Intra; WrapperAttributes=`./cocomin81 COCOMINWrapper_TrainCenter2Intra "backward" "med_mre_hi" "mmre" $Seed`; cat trainCenter2IntraN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TrainCenter2Intra.arff SelectedAttributes=$WrapperAttributes cat testCenter2N.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TestCenter2Intra.arff SelectedAttributes=$WrapperAttributes WrapperAttributes=`./cocomin81 COCOMINWrapper_TrainCenter2Inter "backward" "med_mre_hi" "mmre" $Seed`; cat trainCenter2InterN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TrainCenter2Inter.arff SelectedAttributes=$WrapperAttributes cat testCenter2N.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TestCenter2Inter.arff SelectedAttributes=$WrapperAttributes WrapperAttributes=`./cocomin81 COCOMINWrapper_TrainCenter5Intra "backward" "med_mre_hi" "mmre" $Seed`; cat trainCenter5IntraN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TrainCenter5Intra.arff SelectedAttributes=$WrapperAttributes cat testCenter5N.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TestCenter5Intra.arff SelectedAttributes=$WrapperAttributes WrapperAttributes=`./cocomin81 COCOMINWrapper_TrainCenter5Inter "backward" "med_mre_hi" "mmre" $Seed`; cat trainCenter5InterN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TrainCenter5Inter.arff SelectedAttributes=$WrapperAttributes cat testCenter5N.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_TestCenter5Inter.arff SelectedAttributes=$WrapperAttributes for Learner in $Learners; do Prefix="$R,$WRAPPER,${Learner},center2,inter"; . $Sandbox/$Learner COCOMINWrapper_TrainCenter2Inter.arff COCOMINWrapper_TestCenter2Inter.arff; Prefix="$R,$WRAPPER,${Learner},center2,intra"; . $Sandbox/$Learner COCOMINWrapper_TrainCenter2Intra.arff COCOMINWrapper_TestCenter2Intra.arff; Prefix="$R,$WRAPPER,${Learner},center5,inter"; . $Sandbox/$Learner COCOMINWrapper_TrainCenter5Inter.arff COCOMINWrapper_TestCenter5Inter.arff; Prefix="$R,$WRAPPER,${Learner},center5,intra"; . $Sandbox/$Learner COCOMINWrapper_TrainCenter5Intra.arff COCOMINWrapper_TestCenter5Intra.arff; done done } generate > $Log