shark::RFTrainer< unsigned int > Class Template Reference

#include <shark/Algorithms/Trainers/RFTrainer.h>

+ Inheritance diagram for shark::RFTrainer< unsigned int >:

Public Member Functions

 RFTrainer (bool computeFeatureImportances=false, bool computeOOBerror=false)
 Construct and compute feature importances when training or not. More...
 
std::string name () const
 From INameable: return the class name. More...
 
void setMTry (std::size_t mtry)
 
void setNTrees (std::size_t numTrees)
 Set the number of trees to grow. (default 100) More...
 
void setMinSplit (std::size_t numSamples)
 Set Minimum number of samples that is split (default 2) More...
 
void setMaxDepth (std::size_t maxDepth)
 Set Maximum depth of the tree (default 10000) More...
 
void setNodeSize (std::size_t nodeSize)
 
void minImpurity (double impurity)
 The minimum impurity below which a a node is considere pure (default 1.e-10) More...
 
void epsilon (double distance)
 The minimum dtsnace of features to be considered different (detault 1.e-10) More...
 
RealVector parameterVector () const
 Return the parameter vector. More...
 
void setParameterVector (RealVector const &newParameters)
 Set the parameter vector. More...
 
void train (RFClassifier< LabelType > &model, WeightedLabeledData< RealVector, LabelType > const &dataset)
 
- Public Member Functions inherited from shark::AbstractWeightedTrainer< RFClassifier< unsigned int > >
virtual void train (ModelType &model, WeightedDatasetType const &dataset)=0
 Executes the algorithm and trains a model on the given weighted data. More...
 
virtual void train (ModelType &model, DatasetType const &dataset)
 Executes the algorithm and trains a model on the given unweighted data. 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 ()
 
- Public Member Functions inherited from shark::IParameterizable< RealVector >
virtual ~IParameterizable ()
 
virtual std::size_t numberOfParameters () const
 Return the number of parameters. More...
 

Additional Inherited Members

- Public Types inherited from shark::AbstractWeightedTrainer< RFClassifier< unsigned int > >
typedef base_type::ModelType ModelType
 
typedef base_type::InputType InputType
 
typedef base_type::LabelType LabelType
 
typedef base_type::DatasetType DatasetType
 
typedef WeightedLabeledData< InputType, LabelTypeWeightedDatasetType
 
- Public Types inherited from shark::IParameterizable< RealVector >
typedef RealVector ParameterVectorType
 

Detailed Description

template<>
class shark::RFTrainer< unsigned int >

Definition at line 75 of file RFTrainer.h.

Constructor & Destructor Documentation

◆ RFTrainer()

shark::RFTrainer< unsigned int >::RFTrainer ( bool  computeFeatureImportances = false,
bool  computeOOBerror = false 
)
inline

Construct and compute feature importances when training or not.

Definition at line 80 of file RFTrainer.h.

Member Function Documentation

◆ epsilon()

void shark::RFTrainer< unsigned int >::epsilon ( double  distance)
inline

The minimum dtsnace of features to be considered different (detault 1.e-10)

Definition at line 118 of file RFTrainer.h.

◆ minImpurity()

void shark::RFTrainer< unsigned int >::minImpurity ( double  impurity)
inline

The minimum impurity below which a a node is considere pure (default 1.e-10)

Definition at line 115 of file RFTrainer.h.

◆ name()

std::string shark::RFTrainer< unsigned int >::name ( ) const
inlinevirtual

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 93 of file RFTrainer.h.

Referenced by main().

◆ parameterVector()

RealVector shark::RFTrainer< unsigned int >::parameterVector ( ) const
inlinevirtual

Return the parameter vector.

Reimplemented from shark::IParameterizable< RealVector >.

Definition at line 121 of file RFTrainer.h.

◆ setMaxDepth()

void shark::RFTrainer< unsigned int >::setMaxDepth ( std::size_t  maxDepth)
inline

Set Maximum depth of the tree (default 10000)

Definition at line 108 of file RFTrainer.h.

◆ setMinSplit()

void shark::RFTrainer< unsigned int >::setMinSplit ( std::size_t  numSamples)
inline

Set Minimum number of samples that is split (default 2)

Definition at line 105 of file RFTrainer.h.

◆ setMTry()

void shark::RFTrainer< unsigned int >::setMTry ( std::size_t  mtry)
inline

Set the number of random attributes to investigate at each node.

Defualt is 0 which is translated to sqrt(inputDim(data)) during training

Definition at line 99 of file RFTrainer.h.

◆ setNodeSize()

void shark::RFTrainer< unsigned int >::setNodeSize ( std::size_t  nodeSize)
inline

Controls when a node is considered pure. If set to 1, a node is pure when it only consists of a single node.(default 1)

Definition at line 112 of file RFTrainer.h.

◆ setNTrees()

void shark::RFTrainer< unsigned int >::setNTrees ( std::size_t  numTrees)
inline

Set the number of trees to grow. (default 100)

Definition at line 102 of file RFTrainer.h.

◆ setParameterVector()

void shark::RFTrainer< unsigned int >::setParameterVector ( RealVector const &  newParameters)
inlinevirtual

Set the parameter vector.

Reimplemented from shark::IParameterizable< RealVector >.

Definition at line 124 of file RFTrainer.h.

References SHARK_ASSERT.

◆ train()


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