Trainer for naive Bayes classifier. More...
#include <shark/Algorithms/Trainers/NBClassifierTrainer.h>
Inheritance diagram for shark::NBClassifierTrainer< InputType, OutputType >:Public Member Functions | |
| std::string | name () const |
| From INameable: return the class name. More... | |
| void | train (NBClassifierType &model, LabeledData< InputType, OutputType > const &dataset) |
| DistTrainerContainer & | getDistTrainerContainer () |
| Return the distribution trainer container which allows user to check or set individual distribution trainer. More... | |
Public Member Functions inherited from shark::AbstractTrainer< NBClassifier< InputType, OutputType > > | |
| virtual void | train (ModelType &model, DatasetType const &dataset)=0 |
| Core of the Trainer interface. More... | |
Public Member Functions inherited from shark::INameable | |
| virtual | ~INameable () |
Public Member Functions inherited from shark::ISerializable | |
| virtual | ~ISerializable () |
| Virtual d'tor. More... | |
| virtual void | read (InArchive &archive) |
| Read the component from the supplied archive. More... | |
| virtual void | write (OutArchive &archive) const |
| Write the component to the supplied archive. More... | |
| void | load (InArchive &archive, unsigned int version) |
| Versioned loading of components, calls read(...). More... | |
| void | save (OutArchive &archive, unsigned int version) const |
| Versioned storing of components, calls write(...). More... | |
| BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Additional Inherited Members | |
Public Types inherited from shark::AbstractTrainer< NBClassifier< InputType, OutputType > > | |
| typedef NBClassifier< InputType, OutputType > | ModelType |
| typedef ModelType::InputType | InputType |
| typedef typename NBClassifier< InputType, OutputType > ::OutputType | LabelType |
| typedef LabeledData< InputType, LabelType > | DatasetType |
Trainer for naive Bayes classifier.
Basically NB trainer needs to figure out two things for NB classifier: (1) Prior probability of each class (2) Parameters for distributions of each feature given each class
| InputType | the type of feature vector |
| OutputType | the type of class |
Definition at line 58 of file NBClassifierTrainer.h.
|
inline |
Return the distribution trainer container which allows user to check or set individual distribution trainer.
Definition at line 110 of file NBClassifierTrainer.h.
References shark::LabeledData< InputT, LabelT >::elements(), and SHARK_CHECK.
|
inlinevirtual |
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 69 of file NBClassifierTrainer.h.
|
inline |
Definition at line 73 of file NBClassifierTrainer.h.
References shark::classSizes(), shark::NBClassifier< InputType, OutputType >::getDistSize(), shark::NBClassifier< InputType, OutputType >::getFeatureDist(), shark::inputDimension(), shark::numberOfClasses(), shark::LabeledData< InputT, LabelT >::numberOfElements(), shark::NBClassifier< InputType, OutputType >::setClassPrior(), SHARK_CHECK, SIZE_CHECK, and shark::GenericDistTrainer::train().