Xmipp
v3.23.11-Nereus
|
#include <naive_bayes.h>
Public Member Functions | |
LeafNode (const std::vector< MultidimArray< double > > &leafFeatures, int _discrete_levels=8) | |
Constructor. More... | |
double | assignProbability (double value, int k) const |
Assign probability to a value within the PDF of a given class. More... | |
double | computeWeight () const |
Compute weight of this leaf as a classifier. More... | |
Public Attributes | |
int | __discreteLevels |
std::vector< IrregularHistogram1D > | __leafPDF |
int | K |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const LeafNode &leaf) |
Show. More... | |
Leaf node class.
This class is for a single feature. After receiving a set of features, it discretizes the features and builds the probability density function in an irregular histogram. There is an irregular histogram for each class.
Definition at line 45 of file naive_bayes.h.
LeafNode::LeafNode | ( | const std::vector< MultidimArray< double > > & | leafFeatures, |
int | _discrete_levels = 8 |
||
) |
Constructor.
Definition at line 127 of file naive_bayes.cpp.
double LeafNode::assignProbability | ( | double | value, |
int | k | ||
) | const |
Assign probability to a value within the PDF of a given class.
Definition at line 244 of file naive_bayes.cpp.
double LeafNode::computeWeight | ( | ) | const |
Compute weight of this leaf as a classifier.
Definition at line 252 of file naive_bayes.cpp.
|
friend |
Show.
Definition at line 268 of file naive_bayes.cpp.
int LeafNode::__discreteLevels |
Definition at line 49 of file naive_bayes.h.
std::vector< IrregularHistogram1D > LeafNode::__leafPDF |
Definition at line 52 of file naive_bayes.h.
int LeafNode::K |
Definition at line 55 of file naive_bayes.h.