#ifndef __NAIVEBAYES_H__
#define __NAIVEBAYES_H__
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <math.h>

#ifndef PI
#define PI 3.141592653589793238462643383279502884197
#endif 

///implementation of naive bayes classification
/**
 */
class naivebayes
{
 public:
  naivebayes();
  ~naivebayes();

  int train( std::vector< double* > &sample, int fs );

  long double prob( double *sample );

  long double prob( std::vector< double > &sample );

  int print();

  struct model
  {
    double mean;
    double variance;
    double prefix;
  };

 private:

  int calcmean( std::vector<double*> &d );
  int calcvariance( std::vector<double*> &d );

  std::vector< model > nbmodel;
  int featuresize;
  int trainingsize;
};

#endif
