[Spambayes-checkins] spambayes/testtools incremental.py,1.3,1.4

T. Alexander Popiel popiel at users.sourceforge.net
Fri Feb 28 09:57:57 EST 2003


Update of /cvsroot/spambayes/spambayes/testtools
In directory sc8-pr-cvs1:/tmp/cvs-serv32368

Modified Files:
	incremental.py 
Log Message:
Fix name conflict between regimes list and regimes source file.
Reduce the amount of progress output, speeding it up...



Index: incremental.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/testtools/incremental.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** incremental.py	28 Feb 2003 17:52:01 -0000	1.3
--- incremental.py	28 Feb 2003 17:57:53 -0000	1.4
***************
*** 298,302 ****
  
      tests = []
!     regimes = []
      nham_tested = []
      nham_trained = []
--- 298,302 ----
  
      tests = []
!     rules = []
      nham_tested = []
      nham_trained = []
***************
*** 313,317 ****
          #     continue
          tests.append(Test(classifier.Bayes()))
!         exec """regimes.append(regimes.%s())""" % (regime) in globals(), locals()
          nham_tested.append([])
          nham_trained.append([])
--- 313,317 ----
          #     continue
          tests.append(Test(classifier.Bayes()))
!         exec """rules.append(regimes.%s())""" % (regime) in globals(), locals()
          nham_tested.append([])
          nham_trained.append([])
***************
*** 334,340 ****
          isspam = (dir.find('Spam') >= 0)
   
-         sys.stderr.write("%-78s\r" % ("%s  : %d" % (base, set)))
-         sys.stderr.flush()
-  
          msg = msgs.Msg(dir, base)
          
--- 334,337 ----
***************
*** 343,346 ****
--- 340,346 ----
                  continue
              if group != oldgroup:
+                 sys.stderr.write("%-78s\r" % ("%s  : %d" % (base, set)))
+                 sys.stderr.flush()
+  
                  nham_tested[j].append(tests[j].nham_tested)
                  nham_trained[j].append(tests[j].nham_trained)
***************
*** 354,358 ****
                  nspam_unsure[j].append(tests[j].nspam_unsure)
                  # tests[j].reset_test_results()
!                 regimes[j].group_action(j, tests[j])
   
              if j != set:
--- 354,358 ----
                  nspam_unsure[j].append(tests[j].nspam_unsure)
                  # tests[j].reset_test_results()
!                 rules[j].group_action(j, tests[j])
   
              if j != set:
***************
*** 362,366 ****
                  else:
                      actual = 1
!                 todo = regimes[j].guess_action(j, tests[j], guess, actual, msg)
                  if todo == -1:
                      tests[j].train(None, [msg])
--- 362,366 ----
                  else:
                      actual = 1
!                 todo = rules[j].guess_action(j, tests[j], guess, actual, msg)
                  if todo == -1:
                      tests[j].train(None, [msg])





More information about the Spambayes-checkins mailing list