Implements Bayes classifier based on normal (gaussian) model. More...
#include <classifier_normal_bayes.hpp>
Public Types | |
typedef boost::shared_ptr < DATAACCESSOR > | PDataAccessor |
typedef boost::shared_ptr < SUBSET > const | PSubset |
typedef DATAACCESSOR::PPattern | PPattern |
Public Member Functions | |
void | enable_prelearn_mode (const PDataAccessor da) |
void | disable_prelearn_mode () |
bool | get_prelearn_mode () const |
void | initialize (const PDataAccessor da) |
virtual bool | classify (DIMTYPE &cls, const PPattern &pattern) |
classifies pattern, returns the respective class index | |
virtual bool | train (const PDataAccessor da, const PSubset sub) |
learns from designated training part of data | |
virtual bool | test (RETURNTYPE &result, const PDataAccessor da) |
estimates accuracy using designated test data | |
DIMTYPE | get_n () const |
DIMTYPE | get_d () const |
Classifier_Normal_Bayes * | clone () const |
Classifier_Normal_Bayes * | sharing_clone () const |
Classifier_Normal_Bayes * | stateless_clone () const |
virtual std::ostream & | print (std::ostream &os) const |
Protected Attributes | |
boost::scoped_ptr < Model_Normal< DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > > | _model |
DIMTYPE | _classes |
DIMTYPE | _features |
boost::scoped_ptr < Indexed_Matrix< REALTYPE, DIMTYPE, SUBSET > > | _LUtemp |
boost::scoped_array < Indexed_Matrix< REALTYPE, DIMTYPE, SUBSET > > | _inverse |
boost::scoped_array< REALTYPE > | _det |
boost::scoped_array< REALTYPE > | _constant |
boost::scoped_array< REALTYPE > | _pxw |
boost::scoped_array< REALTYPE > | _Pwx |
Private Member Functions | |
Classifier_Normal_Bayes (const Classifier_Normal_Bayes &cnb) | |
Private Attributes | |
bool | _prelearn_mode |
boost::scoped_array< DIMTYPE > | _index |
DIMTYPE | _subfeatures |
Implements Bayes classifier based on normal (gaussian) model.
void FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::enable_prelearn_mode | ( | const PDataAccessor | da | ) | [inline] |
Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > * FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::clone | ( | ) | const [inline, virtual] |
create 1:1 independent clone of the current object
Implements FST::Clonable.
Classifier_Normal_Bayes* FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::sharing_clone | ( | ) | const [inline, virtual] |
create equivalent clone of the current object, parmitting read-only access to structures in the source object (allows referencing instead of copying of large memory structures). may be faster and save space but requires more caution with respect to concurrency Use example: Data_Accessor memory data representation cloning
Implements FST::Clonable.
Classifier_Normal_Bayes* FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::stateless_clone | ( | ) | const [inline, virtual] |
create clone of the current object, ignoring internal temporary structures to save speed. Does not replicate exact object state. The clone must be used carefully in a way that ensures internal structure re-initialization Use example: Data_Splitter cloning or Classifier_SVM cloning due to inability to clone external structures defined in LibSVM
Implements FST::Clonable.