#!/bin/bash # $1 Location of directory of directories to convert from arff to which/t3 # $2 Location of output directory. # $3 if "i" - Discretize on equal value. # "f" - Discretize on equal frequency. # "n" - No Discretization. # $4 If we are discretizing, this is the number of bins. dirs=`ls $1`; for dir in $dirs do files=`ls $1$dir/*.arff`; for file in $files do stem=`basename $file .arff`; echo "Converting $stem and storing results in $2/$stem"; if [ $3 = "i" ]; then ./nbins Bins=$4 Pass=1 $file Pass=2 $file | ./arffToWhich file="$2/$stem"; elif [ $3 = "f" ]; then ./eqfrdscr nBins=$4 $file | ./arffToWhich file="$2/$stem"; else ./arffToWhich file="$2/$stem" $file; fi done done