#!/usr/local/bin/tcsh

set degree=2

date 
echo "===> Training SVM"
echo "svmfutrain -a -f face.train.normgrey -C 10 -d $degree -b 1 -n 10 -k polynomial -s svmo-${degree}.svm -h 7000"

svmfutrain -a -f face.train.normgrey -C 10 -d $degree -b 1 -n 10 -k polynomial -s svmo-${degree}.svm -h 7000 

echo "===> Done with training"

date
echo "===> Testing SVM"
svmfutest -a -f face.test.normgrey -k polynomial -d $degree -b 1 -n 10 -s svmo-${degree}.svm -p > svmfu-${degree}.output 
date
echo "===> Done with testing"

echo "===> Generating ROC curve"
roc-mit.perl -svmfu svmfu-${degree}.output > svm-roc-${degree}.dat

echo "===> Plotting figures"
gnuplot plot-svm.gnp

convert roc-svm.png roc-svm.gif

echo "===> Done"
