Re: Training on data using timcv.py
Jonas <[email protected]> Mon, 21 Jan 2013 12:12:00 +0100
| Newsgroups | gmane.mail.spam.spambayes.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I think, there is a bug in TestDriver.py:
I modified line 146 and added another line:
Previosly it was:
146 self.tester = Tester.Test(classifier)
Now:
146 self.tester = Tester.Test()
147 self.tester.set_classifier(classifier);
timcv.py can be now executed.
Jonas
Zitat von Jonas <[email protected]>:
> 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
> _______________________________________________
> [email protected]
> http://mail.python.org/mailman/listinfo/spambayes
> Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes
> Check the FAQ before asking: http://spambayes.sf.net/faq.html
_______________________________________________
[email protected]
http://mail.python.org/mailman/listinfo/spambayes
Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes
Check the FAQ before asking: http://spambayes.sf.net/faq.html