shark::NBClassifierTrainer< InputType, OutputType > Class Template Reference

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)
 
DistTrainerContainergetDistTrainerContainer ()
 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, LabelTypeDatasetType
 

Detailed Description

template<class InputType = RealVector, class OutputType = unsigned int>
class shark::NBClassifierTrainer< InputType, OutputType >

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

Template Parameters
InputTypethe type of feature vector
OutputTypethe type of class

Definition at line 58 of file NBClassifierTrainer.h.

Member Function Documentation

§ getDistTrainerContainer()

template<class InputType = RealVector, class OutputType = unsigned int>
DistTrainerContainer& shark::NBClassifierTrainer< InputType, OutputType >::getDistTrainerContainer ( )
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.

§ name()

template<class InputType = RealVector, class OutputType = unsigned int>
std::string shark::NBClassifierTrainer< InputType, OutputType >::name ( ) const
inlinevirtual

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 69 of file NBClassifierTrainer.h.

§ train()


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