faif
|
Naive Bayesian Classifier. More...
#include <NaiveBayesian.hpp>
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 Domains & | getAttrDomains () const |
accessor More... | |
const AttrDomain & | getCategoryDomain () const |
accessor More... | |
AttrIdd | getCategoryIdd (const AttrValue &val) const |
accessor (helper) More... | |
Friends | |
class | boost::serialization::access |
serialization using boost::serialization More... | |
Naive Bayesian Classifier.
Contains the attributes, attribute values and categories, train examples, test examples and classifier methods.
|
virtual |
the clear the learned parameters
Implements faif::ml::Classifier< Val >.
Referenced by faif::ml::NaiveBayesian< Val >::switchAddTraining().
|
inlinevirtual |
learn classifier (on the collection of training examples)
Implements faif::ml::Classifier< Val >.
References faif::ml::NaiveBayesian< Val >::getCategories(), faif::ml::NaiveBayesian< Val >::getCategory(), faif::ml::NaiveBayesian< Val >::switchAddTraining(), faif::ml::NaiveBayesian< Val >::switchGetCategories(), faif::ml::NaiveBayesian< Val >::switchGetCategory(), faif::ml::NaiveBayesian< Val >::switchLoadSaveState(), faif::ml::NaiveBayesian< Val >::trainIncremental(), and faif::ml::NaiveBayesian< Val >::write().
|
virtual |
classify (Naive Bayes Classifier)
Implements faif::ml::Classifier< Val >.
Referenced by faif::ml::NaiveBayesian< Val >::switchGetCategory(), and faif::ml::NaiveBayesian< Val >::train().
|
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().
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().
|
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().
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().
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().
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().
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().
|
inlineinherited |
accessor
Referenced by faif::ml::createExample(), faif::ml::createExampleStrict(), and faif::ml::RandomForest< Val >::getCategories().
|
inlineinherited |
accessor
Referenced by faif::ml::createExample().
|
inlineinherited |
|
friend |
serialization using boost::serialization