diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-05 21:29:40 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-05 21:29:40 +0400 |
commit | 5d0e4d334fef7f0fe683040d32e2a53b503315f2 (patch) | |
tree | d2f00bbb940564a4e77a287f84c7876e8fd9c009 /src/classifiers/classifiers.h | |
parent | 80b5b55a53622875d4973ea1d440dc7fa916f20b (diff) | |
download | rspamd-5d0e4d334fef7f0fe683040d32e2a53b503315f2.tar.gz rspamd-5d0e4d334fef7f0fe683040d32e2a53b503315f2.zip |
* Fixes to winnow learning
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r-- | src/classifiers/classifiers.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h index 02192d795..f69c1284c 100644 --- a/src/classifiers/classifiers.h +++ b/src/classifiers/classifiers.h @@ -24,9 +24,10 @@ struct classify_weight { struct classifier { char *name; struct classifier_ctx* (*init_func)(memory_pool_t *pool, struct classifier_config *cf); - void (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); - void (*learn_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, - stat_file_t *file, GTree *input, gboolean in_class, double *sum, double multiplier); + gboolean (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); + gboolean (*learn_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, + const char *symbol, GTree *input, gboolean in_class, + double *sum, double multiplier, GError **err); GList* (*weights_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); }; @@ -35,9 +36,9 @@ struct classifier* get_classifier (char *name); /* Winnow algorithm */ struct classifier_ctx* winnow_init (memory_pool_t *pool, struct classifier_config *cf); -void winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); -void winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, stat_file_t *file, GTree *input, - gboolean in_class, double *sum, double multiplier); +gboolean winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); +gboolean winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input, + gboolean in_class, double *sum, double multiplier, GError **err); GList *winnow_weights (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); |