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,
66 template <
class FeatureType,
78 std::vector<ExampleIndex>& examples,
79 std::vector<LabelType>& label_data)
81 const std::size_t num_of_examples = examples.size();
82 label_data.resize(num_of_examples, 0);
84 for (std::size_t forest_index = 0; forest_index < forest.size(); ++forest_index) {
85 tree_evaluator_.evaluateAndAdd(forest[forest_index],
93 const float inv_num_of_trees = 1.0f /
static_cast<float>(forest.size());
94 for (std::size_t label_index = 0; label_index < label_data.size(); ++label_index) {
95 label_data[label_index] *= inv_num_of_trees;
99 template <
class FeatureType,
111 ExampleIndex example,
112 std::vector<NodeType>& leaves)
114 leaves.resize(forest.size());
115 for (std::size_t forest_index = 0; forest_index < forest.size(); ++forest_index) {
117 tree_evaluator_.evaluate(forest[forest_index],
123 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.