Xmipp
v3.23.11-Nereus
|
#include <naive_bayes.h>
Public Member Functions | |
EnsembleNaiveBayes (const std::vector< MultidimArray< double > > &features, const Matrix1D< double > &priorProbs, int discreteLevels, int numberOfClassifiers, double samplingFeatures, double samplingIndividuals, const std::string &newJudgeCombination) | |
Constructor. More... | |
~EnsembleNaiveBayes () | |
Destructor. More... | |
EnsembleNaiveBayes (const EnsembleNaiveBayes &other) | |
Copy constructor. More... | |
EnsembleNaiveBayes & | operator= (const EnsembleNaiveBayes &other) |
Assignment. More... | |
void | setCostMatrix (const Matrix2D< double > &cost) |
Set cost matrix. More... | |
int | doInference (const Matrix1D< double > &newFeatures, double &cost, MultidimArray< int > &votes, Matrix1D< double > &classesProbs, Matrix1D< double > &allCosts) |
Returns the class with the largest probability given a set of features. More... | |
Public Attributes | |
std::vector< NaiveBayes *> | ensemble |
Ensemble of classifiers. More... | |
std::vector< MultidimArray< int > > | ensembleFeatures |
Ensemble of features for each classifier. More... | |
int | K |
Number of classes. More... | |
std::string | judgeCombination |
Judge combination. More... | |
Ensemble NaiveBayes classifier.
Definition at line 127 of file naive_bayes.h.
EnsembleNaiveBayes::EnsembleNaiveBayes | ( | const std::vector< MultidimArray< double > > & | features, |
const Matrix1D< double > & | priorProbs, | ||
int | discreteLevels, | ||
int | numberOfClassifiers, | ||
double | samplingFeatures, | ||
double | samplingIndividuals, | ||
const std::string & | newJudgeCombination | ||
) |
Constructor.
Definition at line 431 of file naive_bayes.cpp.
EnsembleNaiveBayes::~EnsembleNaiveBayes | ( | ) |
Destructor.
Definition at line 516 of file naive_bayes.cpp.
|
inline |
int EnsembleNaiveBayes::doInference | ( | const Matrix1D< double > & | newFeatures, |
double & | cost, | ||
MultidimArray< int > & | votes, | ||
Matrix1D< double > & | classesProbs, | ||
Matrix1D< double > & | allCosts | ||
) |
Returns the class with the largest probability given a set of features.
Definition at line 550 of file naive_bayes.cpp.
EnsembleNaiveBayes & EnsembleNaiveBayes::operator= | ( | const EnsembleNaiveBayes & | other | ) |
Assignment.
Definition at line 524 of file naive_bayes.cpp.
void EnsembleNaiveBayes::setCostMatrix | ( | const Matrix2D< double > & | cost | ) |
Set cost matrix.
Definition at line 542 of file naive_bayes.cpp.
std::vector< NaiveBayes * > EnsembleNaiveBayes::ensemble |
Ensemble of classifiers.
Definition at line 131 of file naive_bayes.h.
std::vector< MultidimArray<int> > EnsembleNaiveBayes::ensembleFeatures |
Ensemble of features for each classifier.
Definition at line 134 of file naive_bayes.h.
std::string EnsembleNaiveBayes::judgeCombination |
Judge combination.
Definition at line 140 of file naive_bayes.h.
int EnsembleNaiveBayes::K |
Number of classes.
Definition at line 137 of file naive_bayes.h.