MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / FindBestSplits

Method FindBestSplits

src/treelearner/gpu_tree_learner.cpp:1049–1068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049void GPUTreeLearner::FindBestSplits() {
1050 SerialTreeLearner::FindBestSplits();
1051
1052#if GPU_DEBUG >= 3
1053 for (int feature_index = 0; feature_index < num_features_; ++feature_index) {
1054 if (!is_feature_used_[feature_index]) continue;
1055 if (parent_leaf_histogram_array_ != nullptr
1056 && !parent_leaf_histogram_array_[feature_index].is_splittable()) {
1057 smaller_leaf_histogram_array_[feature_index].set_is_splittable(false);
1058 continue;
1059 }
1060 size_t bin_size = train_data_->FeatureNumBin(feature_index) + 1;
1061 printf("Feature %d smaller leaf:\n", feature_index);
1062 PrintHistograms(smaller_leaf_histogram_array_[feature_index].RawData() - 1, bin_size);
1063 if (larger_leaf_splits_ == nullptr || larger_leaf_splits_->LeafIndex() < 0) { continue; }
1064 printf("Feature %d larger leaf:\n", feature_index);
1065 PrintHistograms(larger_leaf_histogram_array_[feature_index].RawData() - 1, bin_size);
1066 }
1067#endif
1068}
1069
1070void GPUTreeLearner::Split(Tree* tree, int best_Leaf, int* left_leaf, int* right_leaf) {
1071 const SplitInfo& best_split_info = best_split_per_leaf_[best_Leaf];

Callers

nothing calls this directly

Calls 6

PrintHistogramsFunction · 0.70
is_splittableMethod · 0.45
set_is_splittableMethod · 0.45
FeatureNumBinMethod · 0.45
RawDataMethod · 0.45
LeafIndexMethod · 0.45

Tested by

no test coverage detected