aboutsummaryrefslogtreecommitdiffstats
path: root/src/classifiers/classifiers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r--src/classifiers/classifiers.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h
index f69c1284c..0e6df173a 100644
--- a/src/classifiers/classifiers.h
+++ b/src/classifiers/classifiers.h
@@ -6,6 +6,9 @@
#include "../statfile.h"
#include "../tokenizers/tokenizers.h"
+/* Consider this value as 0 */
+#define ALPHA 0.0001
+
struct classifier_config;
struct worker_task;
@@ -41,7 +44,12 @@ gboolean winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const
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);
-
+/* Bayes algorithm */
+struct classifier_ctx* bayes_init (memory_pool_t *pool, struct classifier_config *cf);
+gboolean bayes_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task);
+gboolean bayes_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input,
+ gboolean in_class, double *sum, double multiplier, GError **err);
+GList *bayes_weights (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task);
/* Array of all defined classifiers */
extern struct classifier classifiers[];