faif
Classes | Public Types | Public Member Functions | Friends | List of all members
faif::ml::NaiveBayesian< Val > Class Template Reference

Naive Bayesian Classifier. More...

#include <NaiveBayesian.hpp>

Inheritance diagram for faif::ml::NaiveBayesian< Val >:
Inheritance graph
Collaboration diagram for faif::ml::NaiveBayesian< Val >:
Collaboration graph

Public Types

typedef Classifier< Val >::AttrValue AttrValue
 
typedef Classifier< Val >::AttrDomain AttrDomain
 
typedef Classifier< Val >::AttrIdd AttrIdd
 
typedef Classifier< Val >::AttrIddSerialize AttrIddSerialize
 
typedef Classifier< Val >::Domains Domains
 
typedef Classifier< Val >::Beliefs Beliefs
 
typedef Classifier< Val >::ExampleTest ExampleTest
 
typedef Classifier< Val >::ExampleTrain ExampleTrain
 
typedef Classifier< Val >::ExamplesTrain ExamplesTrain
 
typedef Val Value
 

Public Member Functions

 NaiveBayesian (const Domains &attr_domains, const AttrDomain &category_domain)
 
virtual void reset ()
 
virtual void train (const ExamplesTrain &e)
 learn classifier (on the collection of training examples) More...
 
virtual AttrIdd getCategory (const ExampleTest &) const
 
virtual Beliefs getCategories (const ExampleTest &) const
 classify and return all classes with belief that the example is from given class More...
 
void trainIncremental (const ExampleTrain &)
 
virtual void write (std::ostream &os) const
 
AttrIdd switchGetCategory (const ExampleTest &example)
 
Beliefs switchGetCategories (const ExampleTest &example)
 
void switchAddTraining (const ExampleTrain &example)
 
void switchLoadSaveState ()
 
const DomainsgetAttrDomains () const
 accessor More...
 
const AttrDomaingetCategoryDomain () const
 accessor More...
 
AttrIdd getCategoryIdd (const AttrValue &val) const
 accessor (helper) More...
 

Friends

class boost::serialization::access
 serialization using boost::serialization More...
 

Detailed Description

template<typename Val>
class faif::ml::NaiveBayesian< Val >

Naive Bayesian Classifier.

Contains the attributes, attribute values and categories, train examples, test examples and classifier methods.

Member Function Documentation

template<typename Val >
void faif::ml::NaiveBayesian< Val >::reset ( )
virtual

the clear the learned parameters

Implements faif::ml::Classifier< Val >.

Referenced by faif::ml::NaiveBayesian< Val >::switchAddTraining().

template<typename Val>
virtual void faif::ml::NaiveBayesian< Val >::train ( const ExamplesTrain e)
inlinevirtual
template<typename Val >
NaiveBayesian< Val >::AttrIdd faif::ml::NaiveBayesian< Val >::getCategory ( const ExampleTest example) const
virtual
template<typename Val >
NaiveBayesian< Val >::Beliefs faif::ml::NaiveBayesian< Val >::getCategories ( const ExampleTest example) const
virtual

classify and return all classes with belief that the example is from given class

classify and return all classes with belief that the example is from each class

Implements faif::ml::Classifier< Val >.

Referenced by faif::ml::NaiveBayesian< Val >::switchGetCategories(), and faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
void faif::ml::NaiveBayesian< Val >::trainIncremental ( const ExampleTrain example)

incremental learn - add training example

Referenced by faif::ml::NaiveBayesian< Val >::switchAddTraining(), and faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
void faif::ml::NaiveBayesian< Val >::write ( std::ostream &  os) const
virtual

the ostream method

ostraem method

Reimplemented from faif::ml::Classifier< Val >.

References faif::ml::Classifier< Val >::write().

Referenced by faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
NaiveBayesian< Val >::AttrIdd faif::ml::NaiveBayesian< Val >::switchGetCategory ( const ExampleTest example)

change the internal obj to classify add return result of classification

References faif::ml::NaiveBayesian< Val >::getCategory().

Referenced by faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
NaiveBayesian< Val >::Beliefs faif::ml::NaiveBayesian< Val >::switchGetCategories ( const ExampleTest example)

change the internal obj to classify add return result of classification

References faif::ml::NaiveBayesian< Val >::getCategories().

Referenced by faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
void faif::ml::NaiveBayesian< Val >::switchAddTraining ( const ExampleTrain example)

change the internal obj to train and add new example

change the internal obj to train, clear the train, and add new example

References faif::ml::NaiveBayesian< Val >::reset(), and faif::ml::NaiveBayesian< Val >::trainIncremental().

Referenced by faif::ml::NaiveBayesian< Val >::train().

template<typename Val >
void faif::ml::NaiveBayesian< Val >::switchLoadSaveState ( )

change the internal obj to classify, because this object store internal state

change the internal obj to classify and return the internal state

Referenced by faif::ml::NaiveBayesian< Val >::train().

template<typename Val>
const Domains& faif::ml::Classifier< Val >::getAttrDomains ( ) const
inlineinherited
template<typename Val>
const AttrDomain& faif::ml::Classifier< Val >::getCategoryDomain ( ) const
inlineinherited

accessor

Referenced by faif::ml::createExample().

template<typename Val>
AttrIdd faif::ml::Classifier< Val >::getCategoryIdd ( const AttrValue val) const
inlineinherited

Friends And Related Function Documentation

template<typename Val>
friend class boost::serialization::access
friend

serialization using boost::serialization


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