SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
multiclass
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
14
#include <
shogun/machine/NativeMulticlassMachine.h
>
15
#include <
shogun/mathematics/Math.h
>
16
#include <
shogun/features/DotFeatures.h
>
17
18
namespace
shogun {
19
20
class
CLabels;
21
class
CDotFeatures;
22
class
CFeatures;
23
35
class
CGaussianNaiveBayes
:
public
CNativeMulticlassMachine
36
{
37
38
public
:
39
MACHINE_PROBLEM_TYPE
(
PT_MULTICLASS
)
40
41
44
CGaussianNaiveBayes
();
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
inline
const
char
*
get_name
()
const
{
return
"GaussianNaiveBayes"
; };
83
87
virtual
inline
EMachineType
get_classifier_type
() {
return
CT_GAUSSIANNAIVEBAYES
; };
88
89
protected
:
90
95
virtual
bool
train_machine
(
CFeatures
* data=NULL);
96
97
protected
:
98
100
CDotFeatures
*
m_features
;
101
103
int32_t
m_min_label
;
104
106
int32_t
m_num_classes
;
107
109
int32_t
m_dim
;
110
112
SGMatrix<float64_t>
m_means
;
113
115
SGMatrix<float64_t>
m_variances
;
116
118
SGVector<float64_t>
m_label_prob
;
119
121
SGVector<float64_t>
m_rates
;
122
};
123
124
}
125
126
#endif
/* GAUSSIANNAIVEBAYES_H_ */
SHOGUN
Machine Learning Toolbox - Documentation