SHOGUN  v3.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GaussianNaiveBayes.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
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 
17 
18 namespace shogun {
19 
20 class CLabels;
21 class CDotFeatures;
22 class CFeatures;
23 
36 {
37 
38 public:
40 
41 
45 
50  CGaussianNaiveBayes(CFeatures* train_examples, CLabels* train_labels);
51 
55  virtual ~CGaussianNaiveBayes();
56 
60  virtual void set_features(CFeatures* features);
61 
65  virtual CFeatures* get_features();
66 
71  virtual CMulticlassLabels* apply_multiclass(CFeatures* data=NULL);
72 
77  virtual float64_t apply_one(int32_t idx);
78 
82  virtual const char* get_name() const { return "GaussianNaiveBayes"; };
83 
88 
89 protected:
90 
95  virtual bool train_machine(CFeatures* data=NULL);
96 
97 protected:
98 
101 
103  int32_t m_min_label;
104 
106  int32_t m_num_classes;
107 
109  int32_t m_dim;
110 
113 
116 
119 
122 };
123 
124 }
125 
126 #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:35
virtual CMulticlassLabels * apply_multiclass(CFeatures *data=NULL)
Features that support dot products among other operations.
Definition: DotFeatures.h:41
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:115
double float64_t
Definition: common.h:48
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.
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:62
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