[Rspamd-Users] Bayes Classifier Training Issue

Michelle Sullivan michelle at isux.com
Mon Nov 10 21:14:14 UTC 2025


check your config.. look for things like:

 size = "10kB";

change them to:

size = 10kB;

(remove the quotes)..


Michelle Sullivan
http://www.mhix.org/
If we don't find a way out of this soon, I'm gonna lose it. Lose it... It means go crazy, nuts, insane, bonzo, no longer in possession of ones faculties, three fries short of a Happy Meal, wacko!

> On 11 Nov 2025, at 02:59, Kendall Marino via Users <users at lists.rspamd.com> wrote:
> 
> Hello again,
> 
> This time I'm running up against some trouble with training the bayes
> classifier. I've made no modifications to statistic.conf and have attempted
> training these ways:
> 
> 1. bulk training with 'rspamadm classifier_test' pointed at ham and spam
> directories of my own creation
> 
> Output:
> ------
> Spam: 140 train files, 60 cv files; ham: 140 train files, 60 cv files
> Start learn spam, 140 messages, 10 connections
> Start learn ham, 140 messages, 10 connections
> Learning done: 140 spam messages in 1.14 seconds, 140 ham messages in 1.68
> seconds
> Start cross validation, 120 messages, 10 connections
> Metric               Value
> ------------------------------
> True Positives       0
> False Positives      0
> True Negatives       0
> False Negatives      0
> Accuracy             nan
> Precision            nan
> Recall               nan
> F1 Score             nan
> Classified (%)       0.00
> Elapsed time (seconds) 1.15
> 
> 2. HTTP requests to /learnham and /learnspam in bulk.
> 
> Example logs:
> ------
> 2025-11-06 21:36:35 #285897(controller) <39c898>; csession;
> rspamd_redis_classified: internal error: expected table result from Redis
> script, got number
> 2025-11-06 21:36:35 #285897(controller) <39c898>; bayes; bayes_learn_class:
> LEARN_CLASS: class='spam', unlearn=false, tokens=652
> 2025-11-06 21:36:35 #285897(controller) <39c898>; csession;
> rspamd_controller_learn_fin_task: <127.0.0.1> learned message as spam:
> 67bc22e8624fb_287be6090933 at 590cc0c3-ef96-4fe7-92de-6dd412751bde.mail
> 
> Both approaches show that rspamd is performing the training and are
> incrementing the 'Learned' statistic. I have confirmed Redis keys are being
> generated each time, but I assume my problem lies in this line which was
> present in the logs for each request.
> 
> 'rspamd_redis_classified: internal error: expected table result from Redis
> script, got number'
> 
> It's worth noting as well that I'm not seeing BAYES_HAM or BAYES_SPAM
> symbols when scanning a message post-training. I'm assuming this error is
> the root of the issue, but I haven't been able to figure out what's causing
> it. Is it possible I'm missing some additional custom configuration?
> 
> Thanks,
> Kendall
> --
> Users mailing list
> Users at lists.rspamd.com
> https://lists.rspamd.com/mailman/listinfo/users


More information about the Users mailing list