SHOGUN  4.1.0
GaussianNaiveBayes.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Sergey Lisitsyn
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10
11 #ifndef GAUSSIANNAIVEBAYES_H_
12 #define GAUSSIANNAIVEBAYES_H_
13
14 #include <shogun/lib/config.h>
15
19
20 namespace shogun {
21
22 class CLabels;
23 class CDotFeatures;
24 class CFeatures;
25
38 {
39
40 public:
42
43
47
52  CGaussianNaiveBayes(CFeatures* train_examples, CLabels* train_labels);
53
57  virtual ~CGaussianNaiveBayes();
58
62  virtual void set_features(CFeatures* features);
63
67  virtual CFeatures* get_features();
68
73  virtual CMulticlassLabels* apply_multiclass(CFeatures* data=NULL);
74
79  virtual float64_t apply_one(int32_t idx);
80
84  virtual const char* get_name() const { return "GaussianNaiveBayes"; };
85
90
91 protected:
92
97  virtual bool train_machine(CFeatures* data=NULL);
98
99 protected:
100
103
105  int32_t m_min_label;
106
108  int32_t m_num_classes;
109
111  int32_t m_dim;
112
115
118
121
124 };
125
126 }
127
128 #endif /* GAUSSIANNAIVEBAYES_H_ */
EMachineType
Definition: Machine.h:33
SGVector< float64_t > m_label_prob
a priori probabilities of labels
experimental abstract native multiclass machine class
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual CMulticlassLabels * apply_multiclass(CFeatures *data=NULL)
Features that support dot products among other operations.
Definition: DotFeatures.h:44
SGMatrix< float64_t > m_variances
variances for normal distributions of features
SGVector< float64_t > m_rates
label rates
Multiclass Labels for multi-class classification.
int32_t m_num_classes
number of different classes (labels)
virtual EMachineType get_classifier_type()
#define MACHINE_PROBLEM_TYPE(PT)
Definition: Machine.h:120
double float64_t
Definition: common.h:50
int32_t m_min_label
minimal label
virtual void set_features(CFeatures *features)
int32_t m_dim
dimensionality of feature space
virtual const char * get_name() const
virtual bool train_machine(CFeatures *data=NULL)
Class GaussianNaiveBayes, a Gaussian Naive Bayes classifier.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
SGMatrix< float64_t > m_means
means for normal distributions of features
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual CFeatures * get_features()
virtual float64_t apply_one(int32_t idx)
CDotFeatures * m_features
features for training or classifying

SHOGUN Machine Learning Toolbox - Documentation