next up previous contents
Next: Converting Files for Up: Useful Scripts and Previous: Comparing two Inducers

Conversions

Here is an example of a shell script that compares a perceptron with a bagged perceptron. The file datasets.txt should contain a list of file names to compare. The datafile is first converted to local encoding using the conv utility, then an inducer is run and then bagging is done.

#!/bin/tcsh
#Script to compare bagging of perceptron.

set ind = perceptron
setenv MAX_EPOCHS 25
setenv BAG_REPLICATIONS 20
setenv REMOVE_UNKNOWN_INST yes
setenv LOGLEVEL 0

foreach i (`cat datasets.txt`) 
   set file = `basename $i \.all`
   echo ------------------- $file ------------------------
   setenv DATAFILE $file
   setenv DUMPSTEM /tmp/a
   conv
   setenv DATAFILE /tmp/a
   setenv INDUCER $ind
   echo -n "$ind        "
   Inducer | grep Accuracy
   setenv INDUCER bag
   setenv BAG_INDUCER $ind
   echo -n "Bagged $ind "
   Inducer | grep Accuracy
   setenv LOGLEVEL 0
end



Ronny Kohavi
Sun Oct 6 23:17:50 PDT 1996