[Spambayes-checkins] spambayes/scripts sb_server.py,1.26,1.27

Tony Meyer anadelonbrin at users.sourceforge.net
Tue Aug 10 08:48:11 CEST 2004


Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9437/scripts

Modified Files:
	sb_server.py 
Log Message:
Apparently, some people are using spam_cutoff values of 0.3 or lower.  This doesn't
seem like a sensible idea to me at all!  Add a warning about it so that people at least
know that it's not generally what you ought to be doing (and a corresponding one
about the ham_cutoff).

While we're there, warn them if the ham_cutoff is higher than the spam_cutoff, which
means that nothing will work like it is meant to.

Index: sb_server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** sb_server.py	3 Aug 2004 06:51:53 -0000	1.26
--- sb_server.py	10 Aug 2004 06:48:09 -0000	1.27
***************
*** 750,753 ****
--- 750,767 ----
                             "will classify all messages as 'unsure', " \
                             "ready for you to train."
+         # Add an additional warning message if the user's thresholds are
+         # truly odd.
+         spam_cut = options["Categorization", "spam_cutoff"]
+         ham_cut = options["Categorization", "ham_cutoff"]
+         if spam_cut < 0.5:
+             self.warning += "<br/>Warning: we do not recommend setting " \
+                             "the spam threshold less than 0.5."
+         if ham_cut > 0.5:
+             self.warning += "<br/>Warning: we do not recommend setting " \
+                             "the ham threshold greater than 0.5."
+         if ham_cut > spam_cut:
+             self.warning += "<br/>Warning: your ham threshold is " \
+                             "<b>higher</b> than your spam threshold. " \
+                             "Results are unpredictable."
  
      def createWorkers(self):



More information about the Spambayes-checkins mailing list