#!/bin/bash path=../c45/changes/Data/arffData/discrete; dirs=`ls $path`; for dir in $dirs do files=`ls $path/$dir/`; for file in $files do if [ $file != "soybean.arff" ]; then if [ $file != "vehicle.arff" ]; then stem=`basename $file .arff`; b=10; echo $path/$dir/$stem ../c45/changes/Src/play/rand $path/$dir/$stem".arff" | ../c45/changes/Src/play/xval f=$stem bins=$b for ((i=1;i<$b;i++)) do for t in train test do temp=$stem"-"$i"-"$t".arff"; gawk 'BEGIN{d=0;} /@data/{if ( d==0 ) { d=10; print; } next; } {print;}' $temp > "xxx"; mv "xxx" $temp; done done echo "Score" > $stem".txt"; for ((i=1;i<=$b;i++)) do train=$stem"-"$i"-train.arff"; test=$stem"-"$i"-test.arff"; out=$i" "`./which -t $train -T $test -rep 1 -stat -score lift -ssize -1 -imp 0.2 -picks 2000 -check 200`; echo $out; done rm -f *.arff; fi fi done done