Trainer for decision trees.
More...
#include <pcl/ml/dt/decision_tree_trainer.h>
|
void | trainDecisionTreeNode (std::vector< FeatureType > &features, std::vector< ExampleIndex > &examples, std::vector< LabelType > &label_data, std::size_t max_depth, NodeType &node) |
| Trains a decision tree node from the specified features, label data, and examples. More...
|
|
|
static void | createThresholdsUniform (const std::size_t num_of_thresholds, std::vector< float > &values, std::vector< float > &thresholds) |
| Creates uniformly distributed thresholds over the range of the supplied values. More...
|
|
template<class FeatureType, class DataSet, class LabelType, class ExampleIndex, class NodeType>
class pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >
Trainer for decision trees.
Definition at line 56 of file decision_tree_trainer.h.
◆ DecisionTreeTrainer()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
◆ ~DecisionTreeTrainer()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
◆ createThresholdsUniform()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::createThresholdsUniform |
( |
const std::size_t |
num_of_thresholds, |
|
|
std::vector< float > & |
values, |
|
|
std::vector< float > & |
thresholds |
|
) |
| |
|
staticprotected |
Creates uniformly distributed 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 259 of file decision_tree_trainer.hpp.
◆ setDecisionTreeDataProvider()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
Specify the data provider.
- Parameters
-
[in] | dtdp | the data provider that should implement getDatasetAndLabels() function |
Definition at line 174 of file decision_tree_trainer.h.
◆ setExamples()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setExamples |
( |
std::vector< ExampleIndex > & |
examples | ) |
|
|
inline |
◆ setFeatureHandler()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
Sets the feature handler used to create and evaluate features.
- Parameters
-
[in] | feature_handler | the feature handler |
Definition at line 70 of file decision_tree_trainer.h.
◆ setLabelData()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< 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 143 of file decision_tree_trainer.h.
◆ setMaxTreeDepth()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setMaxTreeDepth |
( |
const std::size_t |
max_tree_depth | ) |
|
|
inline |
Sets the maximum depth of the learned tree.
- Parameters
-
[in] | max_tree_depth | maximum depth of the learned tree |
Definition at line 92 of file decision_tree_trainer.h.
◆ setMinExamplesForSplit()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setMinExamplesForSplit |
( |
std::size_t |
n | ) |
|
|
inline |
Sets the minimum number of examples to continue growing a tree.
- Parameters
-
Definition at line 153 of file decision_tree_trainer.h.
◆ setNumOfFeatures()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< 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 102 of file decision_tree_trainer.h.
◆ setNumOfThresholds()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< 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 113 of file decision_tree_trainer.h.
◆ setRandomFeaturesAtSplitNode()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setRandomFeaturesAtSplitNode |
( |
bool |
b | ) |
|
|
inline |
Specify if the features are randomly generated at each split node.
- Parameters
-
Definition at line 189 of file decision_tree_trainer.h.
◆ setStatsEstimator()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
Sets the object for estimating the statistics for tree nodes.
- Parameters
-
[in] | stats_estimator | the statistics estimator |
Definition at line 81 of file decision_tree_trainer.h.
◆ setThresholds()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::setThresholds |
( |
std::vector< float > & |
thres | ) |
|
|
inline |
Specify the thresholds to be used when evaluating features.
- Parameters
-
[in] | thres | the threshold values |
Definition at line 163 of file decision_tree_trainer.h.
◆ setTrainingDataSet()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< 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 123 of file decision_tree_trainer.h.
◆ train()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
◆ trainDecisionTreeNode()
template<class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType >
void pcl::DecisionTreeTrainer< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::trainDecisionTreeNode |
( |
std::vector< FeatureType > & |
features, |
|
|
std::vector< ExampleIndex > & |
examples, |
|
|
std::vector< LabelType > & |
label_data, |
|
|
std::size_t |
max_depth, |
|
|
NodeType & |
node |
|
) |
| |
|
protected |
Trains a decision tree node from the specified features, label data, and examples.
- Parameters
-
[in] | features | the feature pool used for training |
[in] | examples | the examples used for training |
[in] | label_data | the label data corresponding to the examples |
[in] | max_depth | the maximum depth of the remaining tree |
[out] | node | the resulting node |
Definition at line 100 of file decision_tree_trainer.hpp.
The documentation for this class was generated from the following files: