faif
|
Random Forest Classifier. More...
#include <RandomForest.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 | |
RandomForest (const Domains &attr_domains, const AttrDomain &category_domain) | |
const RandomForestParams & | getTrainParams () const |
void | setTrainParams (const RandomForestParams &p) |
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... | |
const Domains & | getAttrDomains () const |
accessor More... | |
const AttrDomain & | getCategoryDomain () const |
accessor More... | |
AttrIdd | getCategoryIdd (const AttrValue &val) const |
accessor (helper) More... | |
virtual void | write (std::ostream &os) const |
Static Public Member Functions | |
static int | getBreimanNumTrees (size_t dataSize, size_t numFeatures) |
get number of trees as per Breiman's recommendation More... | |
static int | getBreimanNumFeatures (size_t numFeatures) |
get number of features per tree as recommended by Breiman More... | |
Friends | |
class | boost::serialization::access |
serialization using boost::serialization More... | |
Random Forest Classifier.
Contains the attributes, attribute values and categories, train examples, test examples and classifier methods.
|
inlinestatic |
get number of trees as per Breiman's recommendation
dataSize | number of examples in the training dataset |
numFeatures | number of features in the training dataset |
|
inlinestatic |
get number of features per tree as recommended by Breiman
numFeatures | number of features in the training dataset |
|
inline |
accessor - get training parameters
|
inline |
mutator - set training parameters
References faif::ml::DecisionTree< Val >::getCategories(), faif::ml::DecisionTree< Val >::getCategory(), faif::ml::DecisionTree< Val >::reset(), and faif::ml::DecisionTree< Val >::train().
|
virtual |
|
virtual |
learn classifier (on the collection of training examples).
Implements faif::ml::Classifier< Val >.
|
virtual |
classify
Implements faif::ml::Classifier< Val >.
|
virtual |
classify and return all classes with belief that the example is from given class
Implements faif::ml::Classifier< Val >.
References faif::ml::Classifier< Val >::getAttrDomains().
|
inlineinherited |
accessor
Referenced by faif::ml::createExample(), faif::ml::createExampleStrict(), and faif::ml::RandomForest< Val >::getCategories().
|
inlineinherited |
accessor
Referenced by faif::ml::createExample().
|
inlineinherited |
|
virtualinherited |
the ostream method
Reimplemented in faif::ml::KNearestNeighbor< Val, Distance >, faif::ml::DecisionTree< Val >, and faif::ml::NaiveBayesian< Val >.
Referenced by faif::ml::Classifier< Val >::getCategoryIdd(), and faif::ml::NaiveBayesian< Val >::write().
|
friend |
serialization using boost::serialization