16 #ifndef __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
17 #define __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
23 namespace naive_bayes {
49 template<
typename MatType = arma::mat>
84 const arma::Col<size_t>& labels,
86 const bool incrementalVariance =
false);
102 void Classify(
const MatType& data, arma::Col<size_t>& results);
124 #include "naive_bayes_classifier_impl.hpp"
MatType & Means()
Modify the sample means for each class.
Linear algebra utility functions, generally performed on matrices or vectors.
void Classify(const MatType &data, arma::Col< size_t > &results)
Given a bunch of data points, this function evaluates the class of each of those data points...
const MatType & Means() const
Get the sample means for each class.
The simple Naive Bayes classifier.
arma::vec probabilities
Class probabilities.
MatType means
Sample mean for each class.
MatType & Variances()
Modify the sample variances for each class.
const MatType & Variances() const
Get the sample variances for each class.
arma::vec & Probabilities()
Modify the prior probabilities for each class.
NaiveBayesClassifier(const MatType &data, const arma::Col< size_t > &labels, const size_t classes, const bool incrementalVariance=false)
Initializes the classifier as per the input and then trains it by calculating the sample mean and var...
MatType variances
Sample variances for each class.
const arma::vec & Probabilities() const
Get the prior probabilities for each class.