41 #include <pcl/ml/dt/decision_forest.h>
42 #include <pcl/ml/dt/decision_tree.h>
43 #include <pcl/ml/dt/decision_tree_trainer.h>
44 #include <pcl/ml/feature_handler.h>
45 #include <pcl/ml/stats_estimator.h>
52 template <
class FeatureType,
73 num_of_trees_to_train_ = num_of_trees;
84 decision_tree_trainer_.setFeatureHandler(feature_handler);
95 decision_tree_trainer_.setStatsEstimator(stats_estimator);
105 decision_tree_trainer_.setMaxTreeDepth(max_tree_depth);
115 decision_tree_trainer_.setNumOfFeatures(num_of_features);
126 decision_tree_trainer_.setNumOfThresholds(num_of_threshold);
136 decision_tree_trainer_.setTrainingDataSet(data_set);
146 decision_tree_trainer_.setExamples(examples);
156 decision_tree_trainer_.setLabelData(label_data);
166 decision_tree_trainer_.setMinExamplesForSplit(n);
176 decision_tree_trainer_.setThresholds(thres);
190 NodeType>::Ptr& dtdp)
192 decision_tree_trainer_.setDecisionTreeDataProvider(dtdp);
202 decision_tree_trainer_.setRandomFeaturesAtSplitNode(b);
214 std::size_t num_of_trees_to_train_{1};
218 decision_tree_trainer_;
223 #include <pcl/ml/impl/dt/decision_forest_trainer.hpp>
Class representing a decision forest.
Trainer for decision trees.
void setMinExamplesForSplit(std::size_t n)
Sets the minimum number of examples to continue growing a tree.
void setStatsEstimator(pcl::StatsEstimator< LabelType, NodeType, DataSet, ExampleIndex > &stats_estimator)
Sets the object for estimating the statistics for tree nodes.
void setNumberOfTreesToTrain(const std::size_t num_of_trees)
Sets the number of trees to train.
void setTrainingDataSet(DataSet &data_set)
Sets the input data set used for training.
void setThresholds(std::vector< float > &thres)
Specify the thresholds to be used when evaluating features.
virtual ~DecisionForestTrainer()
Destructor.
void setNumOfFeatures(const std::size_t num_of_features)
Sets the number of features used to find optimal decision features.
void setRandomFeaturesAtSplitNode(bool b)
Specify if the features are randomly generated at each split node.
void setExamples(std::vector< ExampleIndex > &examples)
Example indices that specify the data used for training.
void setMaxTreeDepth(const std::size_t max_tree_depth)
Sets the maximum depth of the learned tree.
void setDecisionTreeDataProvider(typename pcl::DecisionTreeTrainerDataProvider< FeatureType, DataSet, LabelType, ExampleIndex, NodeType >::Ptr &dtdp)
Specify the data provider.
void setNumOfThresholds(const std::size_t num_of_threshold)
Sets the number of thresholds tested for finding the optimal decision threshold on the feature respon...
void setLabelData(std::vector< LabelType > &label_data)
Sets the label data corresponding to the example data.
void setFeatureHandler(pcl::FeatureHandler< FeatureType, DataSet, ExampleIndex > &feature_handler)
Sets the feature handler used to create and evaluate features.
Trainer for decision trees.
Utility class interface which is used for creating and evaluating features.
Define standard C methods and C++ classes that are common to all methods.