pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType > Class Template Reference

Trainer for a Fern. More...

`#include <pcl/ml/ferns/fern_trainer.h>`

## Public Member Functions

| FernTrainer ()
| Constructor. More...
virtual | ~FernTrainer ()
| Destructor. More...
void | setFeatureHandler (pcl::FeatureHandler< FeatureType, DataSet, ExampleIndex > &feature_handler)
| Sets the feature handler used to create and evaluate features. More...
void | setStatsEstimator (pcl::StatsEstimator< LabelType, NodeType, DataSet, ExampleIndex > &stats_estimator)
| Sets the object for estimating the statistics for tree nodes. More...
void | setFernDepth (const std::size_t fern_depth)
| Sets the maximum depth of the learned tree. More...
void | setNumOfFeatures (const std::size_t num_of_features)
| Sets the number of features used to find optimal decision features. More...
void | setNumOfThresholds (const std::size_t num_of_threshold)
| Sets the number of thresholds tested for finding the optimal decision threshold on the feature responses. More...
void | setTrainingDataSet (DataSet &data_set)
| Sets the input data set used for training. More...
void | setExamples (std::vector< ExampleIndex > &examples)
| Example indices that specify the data used for training. More...
void | setLabelData (std::vector< LabelType > &label_data)
| Sets the label data corresponding to the example data. More...
void | train (Fern< FeatureType, NodeType > &fern)
| Trains a decision tree using the set training data and settings. More...

## Static Protected Member Functions

static void | createThresholdsUniform (const std::size_t num_of_thresholds, std::vector< float > &values, std::vector< float > &thresholds)
| Creates uniformely distrebuted thresholds over the range of the supplied values. More...

## Detailed Description

### template<class FeatureType, class DataSet, class LabelType, class ExampleIndex, class NodeType>
class pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >

Trainer for a Fern.

Definition at line 55 of file fern_trainer.h.

## Constructor & Destructor Documentation

## FernTrainer()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::FernTrainer

Constructor.

Definition at line 47 of file fern_trainer.hpp.

## ~FernTrainer()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::~FernTrainer

virtual

Destructor.

Definition at line 63 of file fern_trainer.hpp.

## Member Function Documentation

## createThresholdsUniform()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::createThresholdsUniform | ( | const std::size_t | num_of_thresholds,
|  | std::vector< float > & | values,
|  | std::vector< float > & | thresholds
| ) |  |

static protected

Creates uniformely distrebuted thresholds over the range of the supplied values.

Parameters

  [in] | num_of_thresholds | the number of thresholds to create
  [in] | values | the values for estimating the expected value range
  [out] | thresholds | the resulting thresholds

Definition at line 299 of file fern_trainer.hpp.

## setExamples()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setExamples | ( | std::vector< ExampleIndex > & | examples | ) |

inline

Example indices that specify the data used for training.

Parameters

  [in] | examples | the examples

Definition at line 132 of file fern_trainer.h.

## setFeatureHandler()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setFeatureHandler | ( | pcl::FeatureHandler< FeatureType, DataSet, ExampleIndex > & | feature_handler | ) |

inline

Sets the feature handler used to create and evaluate features.

Parameters

  [in] | feature_handler | the feature handler

Definition at line 69 of file fern_trainer.h.

## setFernDepth()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setFernDepth | ( | const std::size_t | fern_depth | ) |

inline

Sets the maximum depth of the learned tree.

Parameters

  [in] | fern_depth | maximum depth of the learned tree

Definition at line 91 of file fern_trainer.h.

## setLabelData()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setLabelData | ( | std::vector< LabelType > & | label_data | ) |

inline

Sets the label data corresponding to the example data.

Parameters

  [in] | label_data | the label data

Definition at line 142 of file fern_trainer.h.

## setNumOfFeatures()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setNumOfFeatures | ( | const std::size_t | num_of_features | ) |

inline

Sets the number of features used to find optimal decision features.

Parameters

  [in] | num_of_features | the number of features

Definition at line 101 of file fern_trainer.h.

## setNumOfThresholds()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setNumOfThresholds | ( | const std::size_t | num_of_threshold | ) |

inline

Sets the number of thresholds tested for finding the optimal decision threshold on the feature responses.

Parameters

  [in] | num_of_threshold | the number of thresholds

Definition at line 112 of file fern_trainer.h.

## setStatsEstimator()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setStatsEstimator | ( | pcl::StatsEstimator< LabelType, NodeType, DataSet, ExampleIndex > & | stats_estimator | ) |

inline

Sets the object for estimating the statistics for tree nodes.

Parameters

  [in] | stats_estimator | the statistics estimator

Definition at line 80 of file fern_trainer.h.

## setTrainingDataSet()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setTrainingDataSet | ( | DataSet & | data_set | ) |

inline

Sets the input data set used for training.

Parameters

  [in] | data_set | the data set used for training

Definition at line 122 of file fern_trainer.h.

## train()

template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >

void pcl::FernTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::train | ( | pcl::Fern< FeatureType, NodeType > & | fern | ) |

Trains a decision tree using the set training data and settings.

Parameters

  [out] | fern | destination for the trained tree

Definition at line 72 of file fern_trainer.hpp.

References pcl::Fern< FeatureType, NodeType >::accessFeature(), pcl::Fern< FeatureType, NodeType >::accessThreshold(), and pcl::Fern< FeatureType, NodeType >::initialize().

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

- pcl/ml/ferns/fern_trainer.h
- pcl/ml/impl/ferns/fern_trainer.hpp