[Spambayes-checkins] SF.net SVN: spambayes:[3229] trunk/spambayes/spambayes/Tester.py

montanaro at users.sourceforge.net montanaro at users.sourceforge.net
Tue Jan 27 12:04:58 CET 2009


Revision: 3229
          http://spambayes.svn.sourceforge.net/spambayes/?rev=3229&view=rev
Author:   montanaro
Date:     2009-01-27 11:04:58 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
Adapt Test class interface for use with Nose.

Modified Paths:
--------------
    trunk/spambayes/spambayes/Tester.py

Modified: trunk/spambayes/spambayes/Tester.py
===================================================================
--- trunk/spambayes/spambayes/Tester.py	2009-01-27 11:02:48 UTC (rev 3228)
+++ trunk/spambayes/spambayes/Tester.py	2009-01-27 11:04:58 UTC (rev 3229)
@@ -20,8 +20,7 @@
     #             false_negative_rate(), false_positive_rate(),
     #             false_negatives(), and false_positives()
 
-    def __init__(self, classifier):
-        self.set_classifier(classifier)
+    def __init__(self):
         self.reset_test_results()
 
     # Tell the tester which classifier to use.
@@ -150,7 +149,8 @@
     >>> good2 = _Example('', ['a', 'b'])
     >>> bad1 = _Example('', ['c', 'd'])
 
-    >>> t = Test(Bayes())
+    >>> t = Test()
+    >>> t.set_classifier(Bayes())
     >>> t.train([good1, good2], [bad1])
     >>> t.predict([_Example('goodham', ['a', 'b']),
     ...            _Example('badham', ['d'])    # FP


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the Spambayes-checkins mailing list