[Spambayes] Training on data using timcv.py

s_prior at ira.uka.de s_prior at ira.uka.de
Fri Jan 18 09:01:36 CET 2013


Hi,
for my research project, I need to train spambayes using one of the  
training tools.
I have two mboxes (ham/spam). I splitted them up using splitndirs.py,  
which results in Data/Ham/Set.. and Data/Spam/Set.. .
When I execute "timcv.py -n 5" I receive the following errors:

....
Traceback (most recent call last):
   File "C:\spambayes-src\spambayes\timcv.py", line
  175, in <module>
     main()
   File "C:\spambayes-src\spambayes\timcv.py", line
  172, in main
     drive(nsets)
   File "C:\spambayes-src\spambayes\timcv.py", line
  82, in drive
     d = TestDriver.Driver()
   File  
"C:\Python\64Bit\lib\site-packages\spambayes-1.1b1-py2.7.egg\spambayes\Te
stDriver.py", line 135, in __init__
     self.new_classifier()
   File  
"C:\Python\64Bit\lib\site-packages\spambayes-1.1b1-py2.7.egg\spambayes\Te
stDriver.py", line 141, in new_classifier
     self.set_classifier(classifier.Bayes())
   File  
"C:\Python\64Bit\lib\site-packages\spambayes-1.1b1-py2.7.egg\spambayes\Te
stDriver.py", line 146, in set_classifier
     self.tester = Tester.Test(classifier)
TypeError: __init__() takes exactly 1 argument (2 given)

I could not figure out the error by checking the source code of  
timcv.py and Testdriver.py.
I receive the same error, when I execute timtest.py

Any ideas how to solve the problem? I downloaded spambayes from the  
following source (  
https://spambayes.svn.sourceforge.net/svnroot/spambayes/trunk/spambayes/ ) and  
installed it with "setup.py install".

Jonas




More information about the SpamBayes mailing list