[Spambayes-checkins] spambayes classifier.py,1.26,1.27

Tim Peters tim_one@users.sourceforge.net
Fri, 04 Oct 2002 11:17:51 -0700


Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv2805

Modified Files:
	classifier.py 
Log Message:
Changed the central-limit schemes to produce two "pseudo clues" at the
front of the clue list:

prob('*zham*') = -75.8654
prob('*zspam*') = -48.3459

This is an easy way to get the zscores back to the testing framework
without changing gads of interfaces.


Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/classifier.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** classifier.py	1 Oct 2002 01:31:40 -0000	1.26
--- classifier.py	4 Oct 2002 18:17:48 -0000	1.27
***************
*** 455,458 ****
--- 455,460 ----
              clues = [(word, prob) for prob, word, record in clues]
              clues.sort(lambda a, b: cmp(a[1], b[1]))
+             clues.insert(0, ('*zspam*', zspam))
+             clues.insert(0, ('*zham*', zham))
              return stat, clues
          else:
***************
*** 544,547 ****
--- 546,551 ----
              clues = [(word, prob) for prob, word, record in clues]
              clues.sort(lambda a, b: cmp(a[1], b[1]))
+             clues.insert(0, ('*zspam*', zspam))
+             clues.insert(0, ('*zham*', zham))
              return stat, clues
          else: