MLPACK
1.0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
mlpack
methods
naive_bayes
naive_bayes_classifier.hpp
Go to the documentation of this file.
1
24
#ifndef __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
25
#define __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
26
27
#include <
mlpack/core.hpp
>
28
#include <
mlpack/methods/gmm/phi.hpp
>
29
30
namespace
mlpack {
31
namespace
naive_bayes {
32
57
template
<
typename
MatType = arma::mat>
58
class
NaiveBayesClassifier
59
{
60
private
:
62
MatType
means
;
63
65
MatType
variances
;
66
68
arma::vec
probabilities
;
69
70
public
:
88
NaiveBayesClassifier
(
const
MatType& data,
89
const
arma::Col<size_t>& labels,
90
const
size_t
classes);
91
106
void
Classify
(
const
MatType& data, arma::Col<size_t>& results);
107
109
const
MatType&
Means
()
const
{
return
means
; }
111
MatType&
Means
() {
return
means
; }
112
114
const
MatType&
Variances
()
const
{
return
variances
; }
116
MatType&
Variances
() {
return
variances
; }
117
119
const
arma::vec&
Probabilities
()
const
{
return
probabilities
; }
121
arma::vec&
Probabilities
() {
return
probabilities
; }
122
};
123
124
};
// namespace naive_bayes
125
};
// namespace mlpack
126
127
// Include implementation.
128
#include "naive_bayes_classifier_impl.hpp"
129
130
#endif
Generated by
1.8.3.1