Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
5d6513ef
Commit
5d6513ef
authored
May 08, 2019
by
Yuyang Lan
Committed by
Guolin Ke
May 08, 2019
Browse files
sort after get top K splits (#2154)
parent
1c27a15e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/treelearner/voting_parallel_tree_learner.cpp
src/treelearner/voting_parallel_tree_learner.cpp
+1
-0
No files found.
src/treelearner/voting_parallel_tree_learner.cpp
View file @
5d6513ef
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment