#!/bin/csh

if ($#argv != 3) then 
   echo "Usage: task alg wekaparm"
   exit 1
endif

# used for running weka with algorithms that require one or no
# parameters - use j48run for running j48

set alg=$2
echo algorithm = $alg
##set alg=j48.J48           # the weka learning algorithm to be used
			      # j48.J48 - c4.5 release 8
                              # j48.PART -  c4.5 rules
                              # ZeroR - majority classifier
                              # DecisionStump
	                      # NaiveBayes
				# - o to turn off output

set wekaparms=$3
echo wekaparms = $wekaparms
##set wekaparms='-C 0.25 -M 2'    # parameters for weka learning alg
			            # j48 -C 0.25 -M 2 is default

# save a model created on a set of training data 
java -mx100000000 -oss100000000 weka.classifiers.$alg $wekaparms -d $1-training.$alg.model -t $1-training.xml.arff -T $1-test.xml.arff > $1-training.$alg.out 
echo "$alg done"

# tag the test data using the saved model 

java SensevalClassify -p 2 -l $1-training.$alg.model -T $1-test.xml.arff >$1-test.$alg.answer.dist

echo "wekarun finished $1 $2"
