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
0f0eb69e
Commit
0f0eb69e
authored
Jan 15, 2018
by
Guolin Ke
Browse files
fix a bug in goss
parent
e2835654
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
include/LightGBM/utils/array_args.h
include/LightGBM/utils/array_args.h
+1
-0
src/boosting/goss.hpp
src/boosting/goss.hpp
+1
-1
No files found.
include/LightGBM/utils/array_args.h
View file @
0f0eb69e
...
...
@@ -126,6 +126,7 @@ public:
*
r
=
i
;
};
// Note: k refer to index here. e.g. k=0 means get max number.
inline
static
int
ArgMaxAtK
(
std
::
vector
<
VAL_T
>*
arr
,
int
start
,
int
end
,
int
k
)
{
if
(
start
>=
end
-
1
)
{
return
start
;
...
...
src/boosting/goss.hpp
View file @
0f0eb69e
...
...
@@ -96,7 +96,7 @@ public:
data_size_t
top_k
=
static_cast
<
data_size_t
>
(
cnt
*
gbdt_config_
->
top_rate
);
data_size_t
other_k
=
static_cast
<
data_size_t
>
(
cnt
*
gbdt_config_
->
other_rate
);
top_k
=
std
::
max
(
1
,
top_k
);
ArrayArgs
<
score_t
>::
ArgMaxAtK
(
&
tmp_gradients
,
0
,
static_cast
<
int
>
(
tmp_gradients
.
size
()),
top_k
);
ArrayArgs
<
score_t
>::
ArgMaxAtK
(
&
tmp_gradients
,
0
,
static_cast
<
int
>
(
tmp_gradients
.
size
()),
top_k
-
1
);
score_t
threshold
=
tmp_gradients
[
top_k
-
1
];
score_t
multiply
=
static_cast
<
score_t
>
(
cnt
-
top_k
)
/
other_k
;
...
...
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