From: Vsevolod Stakhov Date: Mon, 13 Apr 2015 16:18:25 +0000 (+0100) Subject: Calculate bayes weight from 0.0 to 1.0 not from 0.5 to 1.0. X-Git-Tag: 0.9.0~264 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53c022725a0be4d076523997b052639e7dbc8ede;p=rspamd.git Calculate bayes weight from 0.0 to 1.0 not from 0.5 to 1.0. --- diff --git a/src/libstat/classifiers/bayes.c b/src/libstat/classifiers/bayes.c index 823f5eff9..1e516ecbb 100644 --- a/src/libstat/classifiers/bayes.c +++ b/src/libstat/classifiers/bayes.c @@ -194,9 +194,7 @@ bayes_classify (struct classifier_ctx * ctx, } else { /* Calculate ham probability correctly */ - if (final_prob < 0.5) { - final_prob = 1. - final_prob; - } + final_prob = (final_prob - 0.5) * 2; rspamd_snprintf (sumbuf, 32, "%.2f%%", final_prob * 100.); cur = g_list_prepend (NULL, sumbuf); rspamd_task_insert_result (task,