[Spambayes] Re: caching stuff

T. Alexander Popiel popiel@wolfskeep.com
Fri Nov 22 21:51:16 2002


In message:  <621ZJEWSC7YV2YB6GAPJPJNLZX7454IG.3dde9f4f@riven>
             <tim@fourstonesExpressions.com> writes:
>
>Well, if the baseian prob changes even if the ham and spam ratios don't, then 
>of course the caching scheme is bad.  But I certainly don't see that in the 
>code that I changed.  Maybe I'm looking in the wrong place...

In the probability computation (which I'm reading from
update_probabilities in an old image):

        prob = spamratio / (hamratio + spamratio)
        n = hamcount + spamcount
        prob = (StimesX + n * prob) / (S + n)


Here we see that prob is based on both the ratios and the
raw counts; thus, they're also based on nham & nspam
(because to get the same non-zero ratio, you'd have to
have a different raw count).

There's normally a hulking huge comment in the middle of
the code snippet above - that may be making it harder to
spot.

- Alex




More information about the Spambayes mailing list