Commit 5d6513ef authored by Yuyang Lan's avatar Yuyang Lan Committed by Guolin Ke
Browse files

sort after get top K splits (#2154)

parent 1c27a15e
...@@ -190,6 +190,7 @@ void VotingParallelTreeLearner<TREELEARNER_T>::GlobalVoting(int leaf_idx, const ...@@ -190,6 +190,7 @@ void VotingParallelTreeLearner<TREELEARNER_T>::GlobalVoting(int leaf_idx, const
// get top k // get top k
std::vector<LightSplitInfo> top_k_splits; std::vector<LightSplitInfo> top_k_splits;
ArrayArgs<LightSplitInfo>::MaxK(feature_best_split, top_k_, &top_k_splits); ArrayArgs<LightSplitInfo>::MaxK(feature_best_split, top_k_, &top_k_splits);
std::sort(top_k_splits.begin(), top_k_splits.end(), std::greater<LightSplitInfo>());
for (auto& split : top_k_splits) { for (auto& split : top_k_splits) {
if (split.gain == kMinScore || split.feature == -1) { if (split.gain == kMinScore || split.feature == -1) {
continue; continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment