80 std::vector<FeatureType> features;
82 if (!random_features_at_split_node_)
83 feature_handler_->createRandomFeatures(num_of_features_, features);
89 if (decision_tree_trainer_data_provider_) {
90 std::cerr <<
"use decision_tree_trainer_data_provider_" << std::endl;
92 decision_tree_trainer_data_provider_->getDatasetAndLabels(
93 data_set_, label_data_, examples_);
94 trainDecisionTreeNode(
95 features, examples_, label_data_, max_tree_depth_, tree.getRoot());
101 trainDecisionTreeNode(
102 features, examples_, label_data_, max_tree_depth_, tree.getRoot());
114 std::vector<ExampleIndex>&
examples,
116 const std::size_t max_depth,
122 "Reached invalid point in decision tree training: Number of examples is 0!\n");
126 if (max_depth == 0) {
136 if (random_features_at_split_node_) {
138 feature_handler_->createRandomFeatures(num_of_features_, features);
142 std::vector<unsigned char> flags;
156 feature_handler_->evaluateFeature(
160 if (!thresholds_.empty()) {
167 stats_estimator_->computeInformationGain(data_set_,
214 feature_handler_->evaluateFeature(
217 stats_estimator_->computeBranchIndices(
225 const std::size_t
num_of_branches = stats_estimator_->getNumOfBranches();
240 stats_estimator_->computeAndSetNodeStats(
262 trainDecisionTreeNode(features,
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.