Feature Selection ToolboxFST3 Library / Documentation

FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > Class Template Reference

Implements Bayes classifier based on normal (gaussian) model. More...

#include <classifier_normal_bayes.hpp>

Inheritance diagram for FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >:
Collaboration diagram for FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >:

List of all members.

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_Bayesclone () const
Classifier_Normal_Bayessharing_clone () const
Classifier_Normal_Bayesstateless_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

Detailed Description

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
class FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >

Implements Bayes classifier based on normal (gaussian) model.

Note:
Classifier_Normal_Bayes should be able to handle _model learning in two ways: either [default] to learn() new subspace model in each train() - usable with FS involving multiple DataAccessor training splits, or to pre-learn() full space model and subsequently only narrow() the model in each train() - much faster, but usable only with non-changing set of training patterns, i.e., for one split data access only
Examples:

demo26.cpp.


Member Function Documentation

template<class RETURNTYPE , typename DATATYPE , typename REALTYPE , typename IDXTYPE , typename DIMTYPE , class SUBSET , class DATAACCESSOR >
void FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR >::enable_prelearn_mode ( const PDataAccessor  da  )  [inline]

pre-learning mode: if true, calls once _model->learn() for full set size and later in train() uses only narrow()ing to access submatrixes (makes sense only as long as training data do not change, i.e., within one split) if false (default), learns new model in each train() call

template<class RETURNTYPE , typename DATATYPE , typename REALTYPE , typename IDXTYPE , typename DIMTYPE , class SUBSET , class DATAACCESSOR >
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.

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
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.

template<class RETURNTYPE, typename DATATYPE, typename REALTYPE, typename IDXTYPE, typename DIMTYPE, class SUBSET, class DATAACCESSOR>
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.


The documentation for this class was generated from the following file:

Generated on Thu Mar 31 11:38:18 2011 for FST3Library by  doxygen 1.6.1