You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Jesper K. Pedersen" <bl...@blackie.dk> on 2004/06/22 19:13:09 UTC

BAYES_* missing in some mails why?

I found that some mails do not have any BAYES_* (e.g. BAYES_10, BAYES_80 etc) 
scores in the X-Spam-Status header field.

Is this a feature or a bug? And if it is a feature, can it be configured, so I 
always get it?

Thanks
Jesper


Re: BAYES_* missing in some mails why?

Posted by Theo Van Dinter <fe...@kluge.net>.
On Tue, Jun 22, 2004 at 03:44:55PM -0400, Ryan Moore wrote:
> If there are no tokens that had previously been seen/tokenized in a 
> given email, then it will score exactly 50.00%.

No matter how many times I say this, it doesn't ever seem to catch on:

If you're curious what is going on with SA, run with -D.  It tells you
lots of interesting things, such as the above case, what tokens match,
"exact" bayes probability (it's a long floating point number...)

Lots of questions are answered by -D ... :)

-- 
Randomly Generated Tagline:
[Rob] Reiner agrees. "If it was made clear to people that we could win
 the war on terrorism by driving a hybrid car, that we could stop global
 warming by driving a hybrid, I think people would do it," he says. "But
 people haven't made those kind of connections."
         - http://www.washingtonpost.com/wp-dyn/articles/A2587-2002Jun5.html

Re: BAYES_* missing in some mails why?

Posted by Ryan Moore <ry...@perigee.net>.
Jesper K. Pedersen wrote:
> Thats strange today I got like 5 mails without a BAYES_.
> I mean look at an X-Spam-Report and you will see something like this:
> *  3.0 -- BODY: Bayesian classifier says spam probability is 70 to 80%
>   [score: 0.7878]
> 
> Notice the number of figures in the score 78.78%
> What are the odds for a mail to hit 50.00% ? Normal statictics would say 1 out 
> of 10.000, and I for sure did not go anywhere close to 50.000 emails today.
> 
> Or are figures rounded before assigned?
> 
> Cheers
> Jesper
> 

If there are no tokens that had previously been seen/tokenized in a 
given email, then it will score exactly 50.00%.


Ryan Moore
----------
Perigee.net Corporation
704-849-8355 (sales)
704-849-8017 (tech)
www.perigee.net

Re: BAYES_* missing in some mails why?

Posted by Matt Kettler <mk...@evi-inc.com>.
At 02:53 PM 6/22/2004, Jesper K. Pedersen wrote:
>What are the odds for a mail to hit 50.00% ? Normal statictics would say 1 
>out
>of 10.000, and I for sure did not go anywhere close to 50.000 emails today.

"normal" statistics would apply statistically even distributions of data.

This is most definitely not a system with any kind of even distributions. 
SA's bayes output is going to have heavy weightings towards 0 and 99, with 
a small spike at exactly 50. (note "BAYES_50" in SA 2.6x does not get the 
exact value of 50)

Bayes results are a function of your bayes training. If the tokens in that 
email aren't in your database it gets a 50. If there are very few tokens 
present, the bayes engine decides it doesn't have enough of a sample to 
make a confident decision, so it gets a 50.

You can reduce the number of 50's through training.


Looking at just my spam-hits (I don't log nonspam hits) I've got a bit 
under 5% of them having BAYES_ absent:

[root@xanadu log]# grep "score\=" maillog |grep  BAYES_ |wc -l
    4977
[root@xanadu log]# grep "score\=" maillog |grep -v BAYES_ |wc -l
     253

253 / (253+4977) = 0.04837 = 4.83%


Also look at STATISTICS-set3.txt from SA 2.63. Note the heavy weights 
towards 00 and 99. I also went and totaled up the percentages..


  44.741   0.0861  95.8440    0.001   1.00   -5.20  BAYES_00
  48.689  91.2161   0.0200    1.000   1.00    3.01  BAYES_99
   1.075   1.9973   0.0193    0.990   0.85    3.00  BAYES_90
   0.397   0.7286   0.0171    0.977   0.81    2.86  BAYES_80
   0.300   0.5502   0.0143    0.975   0.81    2.31  BAYES_70
   0.546   0.0574   1.1057    0.049   0.75   -5.40  BAYES_01
   0.314   0.5539   0.0400    0.933   0.71    1.10  BAYES_60
   0.197   0.0362   0.3812    0.087   0.66   -4.70  BAYES_10
   0.176   0.0374   0.3348    0.101   0.63   -2.60  BAYES_20
   0.178   0.0586   0.3141    0.157   0.52   -0.93  BAYES_30
   0.000   0.0000   0.0000    0.500   0.09    0.00  BAYES_56
   0.000   0.0000   0.0000    0.500   0.09    0.00  BAYES_50
   0.000   0.0000   0.0000    0.500   0.09   -0.00  BAYES_44
   0.000   0.0000   0.0000    0.500   0.09   -0.00  BAYES_40
   ------
   96.613% of all email accounted for.

  3.387% didn't get any BAYES_ rule matches, making this classification the 
third most popular category.

(note: there may be some small deviance here due to cumulative rounding 
errors, but it's going to be quite small. Even assuming an error of 0.0009 
per rule you only get 0.0126 as a total deviance. It's still somewhere over 3%)




Re: BAYES_* missing in some mails why?

Posted by "Jesper K. Pedersen" <bl...@blackie.dk>.
On Tuesday 22 June 2004 19:38, Matt Kettler wrote:
| At 01:13 PM 6/22/2004, Jesper K. Pedersen wrote:
| >I found that some mails do not have any BAYES_* (e.g. BAYES_10, BAYES_80
| > etc) scores in the X-Spam-Status header field.
| >
| >Is this a feature or a bug?
|
| Feature. Bayes scores of exactly 50 are excluded from the rules. This
| generaly means the bayes engine is completely undecided about a given
| email.
|
| >And if it is a feature, can it be configured, so I
| >always get it?
|
| You could add another bayes rule to cover the small hole. Just be sure to
| give it an insignificant score.
|
| Either that, or just realize that whenever BAYES_ is absent, it means the
| message scored dead-on 50/50 chance of being spam/nonspam.
Thats strange today I got like 5 mails without a BAYES_.
I mean look at an X-Spam-Report and you will see something like this:
*  3.0 -- BODY: Bayesian classifier says spam probability is 70 to 80%
  [score: 0.7878]

Notice the number of figures in the score 78.78%
What are the odds for a mail to hit 50.00% ? Normal statictics would say 1 out 
of 10.000, and I for sure did not go anywhere close to 50.000 emails today.

Or are figures rounded before assigned?

Cheers
Jesper

Re: BAYES_* missing in some mails why?

Posted by Matt Kettler <mk...@evi-inc.com>.
At 01:13 PM 6/22/2004, Jesper K. Pedersen wrote:
>I found that some mails do not have any BAYES_* (e.g. BAYES_10, BAYES_80 etc)
>scores in the X-Spam-Status header field.
>
>Is this a feature or a bug?

Feature. Bayes scores of exactly 50 are excluded from the rules. This 
generaly means the bayes engine is completely undecided about a given email.

>And if it is a feature, can it be configured, so I
>always get it?

You could add another bayes rule to cover the small hole. Just be sure to 
give it an insignificant score.

Either that, or just realize that whenever BAYES_ is absent, it means the 
message scored dead-on 50/50 chance of being spam/nonspam.