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:
00088   NaiveBayesClassifier(const MatType& data,
00089                        const arma::Col<size_t>& labels,
00090                        const size_t classes);
00091 
00106   void Classify(const MatType& data, arma::Col<size_t>& results);
00107 
00109   const MatType& Means() const { return means; }
00111   MatType& Means() { return means; }
00112 
00114   const MatType& Variances() const { return variances; }
00116   MatType& Variances() { return variances; }
00117 
00119   const arma::vec& Probabilities() const { return probabilities; }
00121   arma::vec& Probabilities() { return probabilities; }
00122 };
00123 
00124 }; // namespace naive_bayes
00125 }; // namespace mlpack
00126 
00127 // Include implementation.
00128 #include "naive_bayes_classifier_impl.hpp"
00129 
00130 #endif

Generated on 29 Sep 2016 for MLPACK by  doxygen 1.6.1