MLPACK  1.0.4
naive_bayes_classifier.hpp
Go to the documentation of this file.
00001 
00024 #ifndef __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
00025 #define __MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP
00026 
00027 #include <mlpack/core.hpp>
00028 #include <mlpack/methods/gmm/phi.hpp>
00029 
00030 namespace mlpack {
00031 namespace naive_bayes  {
00032 
00057 template<typename MatType = arma::mat>
00058 class NaiveBayesClassifier
00059 {
00060  private:
00062   MatType means;
00063 
00065   MatType variances;
00066 
00068   arma::vec probabilities;
00069 
00070  public:
00086   NaiveBayesClassifier(const MatType& data, const size_t classes);
00087 
00102   void Classify(const MatType& data, arma::Col<size_t>& results);
00103 
00105   const MatType& Means() const { return means; }
00107   MatType& Means() { return means; }
00108 
00110   const MatType& Variances() const { return variances; }
00112   MatType& Variances() { return variances; }
00113 
00115   const arma::vec& Probabilities() const { return probabilities; }
00117   arma::vec& Probabilities() { return probabilities; }
00118 };
00119 
00120 }; // namespace naive_bayes
00121 }; // namespace mlpack
00122 
00123 // Include implementation.
00124 #include "naive_bayes_classifier_impl.hpp"
00125 
00126 #endif