mirror of
https://github.com/Relintai/pmlpp.git
synced 2025-01-09 17:39:37 +01:00
42 lines
924 B
C++
42 lines
924 B
C++
|
//
|
||
|
// GaussianNB.hpp
|
||
|
//
|
||
|
// Created by Marc Melikyan on 1/17/21.
|
||
|
//
|
||
|
|
||
|
#ifndef GaussianNB_hpp
|
||
|
#define GaussianNB_hpp
|
||
|
|
||
|
#include <vector>
|
||
|
|
||
|
namespace MLPP{
|
||
|
class GaussianNB{
|
||
|
|
||
|
public:
|
||
|
GaussianNB(std::vector<std::vector<double>> inputSet, std::vector<double> outputSet, int class_num);
|
||
|
std::vector<double> modelSetTest(std::vector<std::vector<double>> X);
|
||
|
double modelTest(std::vector<double> x);
|
||
|
double score();
|
||
|
|
||
|
private:
|
||
|
|
||
|
void Evaluate();
|
||
|
|
||
|
int class_num;
|
||
|
|
||
|
std::vector<double> priors;
|
||
|
std::vector<double> mu;
|
||
|
std::vector<double> sigma;
|
||
|
|
||
|
std::vector<std::vector<double>> inputSet;
|
||
|
std::vector<double> outputSet;
|
||
|
|
||
|
std::vector<double> y_hat;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif /* GaussianNB_hpp */
|
||
|
}
|