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
0f224c05
Commit
0f224c05
authored
Nov 06, 2018
by
Guolin Ke
Browse files
fix a bug in WeightedPercentile function.
parent
2204e45f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/objective/regression_objective.hpp
src/objective/regression_objective.hpp
+2
-2
No files found.
src/objective/regression_objective.hpp
View file @
0f224c05
...
@@ -48,8 +48,8 @@ namespace LightGBM {
...
@@ -48,8 +48,8 @@ namespace LightGBM {
}\
}\
double threshold = weighted_cdf[cnt_data - 1] * alpha;\
double threshold = weighted_cdf[cnt_data - 1] * alpha;\
size_t pos = std::upper_bound(weighted_cdf.begin(), weighted_cdf.end(), threshold) - weighted_cdf.begin();\
size_t pos = std::upper_bound(weighted_cdf.begin(), weighted_cdf.end(), threshold) - weighted_cdf.begin();\
if (pos == 0) {\
if (pos == 0
|| pos == cnt_data - 1
) {\
return data_reader(sorted_idx[
0
]);\
return data_reader(sorted_idx[
pos
]);\
}\
}\
CHECK(threshold >= weighted_cdf[pos - 1]);\
CHECK(threshold >= weighted_cdf[pos - 1]);\
CHECK(threshold < weighted_cdf[pos]);\
CHECK(threshold < weighted_cdf[pos]);\
...
...
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