#!/bin/bash Here=$1 Sandbox=$2 Repeats=$3 Use=$4 Pred=$5 Learners=$6 Log=$7 let Min=(Use+10) generate(){ for i in *.csv do stem=${i/\.*/} ./csv2arff --ranges rules.config --relation $stem $i > all.arff Size=`./instances all.arff`; [ "$Size" -lt $Min ] && continue ./blab "\n$stem " for((R=1;R<=Repeats;R++)) do ./blab "$R " Seed=$RANDOM ./nArffs Seed=$Seed Tests=$Use all.arff ./cocNums --numbers precise.config test.arff > testN.arff ./cocNums --numbers precise.config train.arff > trainN.arff numberOfAttributes=`./attributes testN.arff` #---------- No Wrapper WRAPPER="None" for Learner in $Learners do Prefix="$R,$WRAPPER,${stem},precise,${numberOfAttributes},${Learner}"; . $Sandbox/$Learner trainN.arff testN.arff; done #---------- COCOMIN Wrapper WRAPPER="COCOMINWrapper" gawk 'BEGIN {FS=OFS=","} /@/ {next} {print $0}' trainN.arff > COCOMINWrapper_Train; WrapperAttributes=`./cocomin81 COCOMINWrapper_Train "backward" "med_mre_hi" "mmre" $Seed`; cat trainN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_Train.arff SelectedAttributes=$WrapperAttributes cat testN.arff | gawk -f attributeSelector.awk OutputFile=COCOMINWrapper_Test.arff SelectedAttributes=$WrapperAttributes numberOfAttributes=`./attributes COCOMINWrapper_Train.arff`; for Learner in $Learners; do Prefix="$R,$WRAPPER,${stem},precise,${numberOfAttributes},${Learner}"; . $Sandbox/$Learner COCOMINWrapper_Train.arff COCOMINWrapper_Test.arff; done done done } generate > $Log