|
From: <jgr...@us...> - 2003-09-04 13:31:13
|
Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv4573/Classifier
Modified Files:
Bayes.pm
Log Message:
Small change to chi2 calculation to use degrees of freedom from the top bucket and not normalize to 1
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.184
retrieving revision 1.185
diff -C2 -d -r1.184 -r1.185
*** Bayes.pm 3 Sep 2003 21:53:11 -0000 1.184
--- Bayes.pm 4 Sep 2003 13:31:06 -0000 1.185
***************
*** 613,617 ****
}
! return ($sum < 1)?$sum:1;
}
--- 613,617 ----
}
! return $sum;
}
***************
*** 719,723 ****
foreach my $bucket (@buckets) {
! $chi{$bucket} = chi2( $score{$bucket}, 2 * $matchcount{$bucket}, -int($score{$ranking[0]}/log(10)) * log(10) );
}
--- 719,723 ----
foreach my $bucket (@buckets) {
! $chi{$bucket} = chi2( $score{$bucket}, 2 * $matchcount{$ranking[0]}, -int($score{$ranking[0]}/log(10)) * log(10) );
}
|