#899 spambayes classification crashes when untrained

open
nobody
hammie (42)
5
2011-08-09
2011-08-09
Anonymous
No

When classifying a message on a untrained dataset the classification crashes on line 293 in classifier.py with a ZeroDivisionError:

prob = spamratio / (hamratio + spamratio)

Easiest fix is to test beforehand "if hamratio+spamratio == 0.0" and return a probability of 0.5.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks