[cvs] bogofilter/tuning tuning.sh,1.3,1.4
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-06-14 19:38:27
|
Update of /cvsroot/bogofilter/bogofilter/tuning In directory sc8-pr-cvs1:/tmp/cvs-serv17498 Modified Files: tuning.sh Log Message: Fix getco and wrapper commands and the calls to them. Index: tuning.sh =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/tuning/tuning.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tuning.sh 5 Jun 2003 17:47:35 -0000 1.3 +++ tuning.sh 14 Jun 2003 19:38:24 -0000 1.4 @@ -70,7 +70,7 @@ function getco () { opts="-m$1 -o$2" - shift ; shift ; shift + shift ; shift res=`cat $* | bogofilter -t -c $CFG $opts -v 2>&1 | \ perl -e ' $target = $ENV{"target"}; while (<>) { ' \ -e ' ($i, $d) = split; push @diffs, $d unless $i != 1; }' \ @@ -83,7 +83,7 @@ function wrapper () { v="-v" opts="-m$1 -o$2" - shift ; shift ; shift + shift ; shift res=`cat $1 | bogofilter -t -c $CFG $opts -v | grep -c $v '^1'` } @@ -93,16 +93,16 @@ date=`date "+%m/%d %H:%M:%S"` echo -n $date " " printf "%-7s %5.3f fpos..." $rs $md - getco $md 0.10 $rs r0.ns.mc r1.ns.mc r2.ns.mc + getco $md,$rs 0.10 r0.ns.mc r1.ns.mc r2.ns.mc fpos=${res##* }; co=${res%% *}; let fpos=$fpos/3 printf "%d at cutoff %8.6f, run0..." $fpos $co - run=0; wrapper $md $co $rs r0.sp.mc; fneg1=$res + run=0; wrapper $md,$rs $co r0.sp.mc; fneg1=$res echo "$rs $md $co $run $fpos $fneg1" >> $PARM_TBL printf "%3d run1..." $fneg1 - run=1; wrapper $md $co $rs r1.sp.mc; fneg2=$res + run=1; wrapper $md,$rs $co r1.sp.mc; fneg2=$res echo "$rs $md $co $run $fpos $fneg2" >> $PARM_TBL printf "%3d run2..." $fneg2 - run=2; wrapper $md $co $rs r2.sp.mc; fneg3=$res + run=2; wrapper $md,$rs $co r2.sp.mc; fneg3=$res echo "$rs $md $co $run $fpos $fneg3" >> $PARM_TBL printf "%3d" $fneg3 let fneg="$fneg1+$fneg2+$fneg3" |