41 #include <pcl/ml/dt/decision_forest.h>
42 #include <pcl/ml/dt/decision_forest_evaluator.h>
43 #include <pcl/ml/feature_handler.h>
44 #include <pcl/ml/stats_estimator.h>
48 template <
class FeatureType,
58 template <
class FeatureType,
67 template <
class FeatureType,
79 std::vector<ExampleIndex>& examples,
80 std::vector<LabelType>& label_data)
82 const std::size_t num_of_examples = examples.size();
83 label_data.resize(num_of_examples, 0);
85 for (std::size_t forest_index = 0; forest_index < forest.size(); ++forest_index) {
86 tree_evaluator_.evaluateAndAdd(forest[forest_index],
94 const float inv_num_of_trees = 1.0f /
static_cast<float>(forest.size());
95 for (std::size_t label_index = 0; label_index < label_data.size(); ++label_index) {
96 label_data[label_index] *= inv_num_of_trees;
100 template <
class FeatureType,
112 ExampleIndex example,
113 std::vector<NodeType>& leaves)
115 leaves.resize(forest.size());
116 for (std::size_t forest_index = 0; forest_index < forest.size(); ++forest_index) {
118 tree_evaluator_.evaluate(forest[forest_index],
124 leaves[forest_index] = leave;
virtual ~DecisionForestEvaluator()
Destructor.
DecisionForestEvaluator()
Constructor.
void evaluate(pcl::DecisionForest< NodeType > &DecisionForestEvaluator, pcl::FeatureHandler< FeatureType, DataSet, ExampleIndex > &feature_handler, pcl::StatsEstimator< LabelType, NodeType, DataSet, ExampleIndex > &stats_estimator, DataSet &data_set, std::vector< ExampleIndex > &examples, std::vector< LabelType > &label_data)
Evaluates the specified examples using the supplied forest.
Class representing a decision forest.
Utility class interface which is used for creating and evaluating features.
Define standard C methods and C++ classes that are common to all methods.