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

Random Forest Classifier. More...

#include <RandomForest.hpp>

Inheritance diagram for faif::ml::RandomForest< Val >:
Inheritance graph
Collaboration diagram for faif::ml::RandomForest< 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

 RandomForest (const Domains &attr_domains, const AttrDomain &category_domain)
 
const RandomForestParamsgetTrainParams () 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 DomainsgetAttrDomains () const
 accessor More...
 
const AttrDomaingetCategoryDomain () 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...
 

Detailed Description

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

Random Forest Classifier.

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

Member Function Documentation

template<typename Val>
static int faif::ml::RandomForest< Val >::getBreimanNumTrees ( size_t  dataSize,
size_t  numFeatures 
)
inlinestatic

get number of trees as per Breiman's recommendation

Parameters
dataSizenumber of examples in the training dataset
numFeaturesnumber of features in the training dataset
template<typename Val>
static int faif::ml::RandomForest< Val >::getBreimanNumFeatures ( size_t  numFeatures)
inlinestatic

get number of features per tree as recommended by Breiman

Parameters
numFeaturesnumber of features in the training dataset
template<typename Val>
const RandomForestParams& faif::ml::RandomForest< Val >::getTrainParams ( ) const
inline

accessor - get training parameters

template<typename Val>
void faif::ml::RandomForest< Val >::setTrainParams ( const RandomForestParams p)
inline
template<typename Val >
void faif::ml::RandomForest< Val >::reset ( )
virtual

clear forest

clear the forest

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

template<typename Val >
void faif::ml::RandomForest< Val >::train ( const ExamplesTrain e)
virtual

learn classifier (on the collection of training examples).

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

template<typename Val >
RandomForest< Val >::AttrIdd faif::ml::RandomForest< Val >::getCategory ( const ExampleTest e) const
virtual

classify

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

template<typename Val >
RandomForest< Val >::Beliefs faif::ml::RandomForest< Val >::getCategories ( const ExampleTest e) const
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().

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
template<typename Val >
void faif::ml::Classifier< Val >::write ( std::ostream &  os) const
virtualinherited

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: