aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 17:18:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 17:18:25 +0100
commit53c022725a0be4d076523997b052639e7dbc8ede (patch)
tree185432aa1070ac7625dc9e41ea435e6c85e17158
parent2e392e7a19ee0526fb9819a68556f27511d048de (diff)
downloadrspamd-53c022725a0be4d076523997b052639e7dbc8ede.tar.gz
rspamd-53c022725a0be4d076523997b052639e7dbc8ede.zip
Calculate bayes weight from 0.0 to 1.0 not from 0.5 to 1.0.
-rw-r--r--src/libstat/classifiers/bayes.c4
1 files changed, 1 insertions, 3 deletions
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,