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
b7a61c32
Commit
b7a61c32
authored
Feb 03, 2019
by
Guolin Ke
Browse files
fix #1994
parent
90127b52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/objective/regression_objective.hpp
src/objective/regression_objective.hpp
+5
-1
No files found.
src/objective/regression_objective.hpp
View file @
b7a61c32
...
@@ -58,7 +58,11 @@ namespace LightGBM {
...
@@ -58,7 +58,11 @@ namespace LightGBM {
CHECK(threshold < weighted_cdf[pos]);\
CHECK(threshold < weighted_cdf[pos]);\
T v1 = data_reader(sorted_idx[pos - 1]);\
T v1 = data_reader(sorted_idx[pos - 1]);\
T v2 = data_reader(sorted_idx[pos]);\
T v2 = data_reader(sorted_idx[pos]);\
return static_cast<T>((threshold - weighted_cdf[pos]) / (weighted_cdf[pos + 1] - weighted_cdf[pos]) * (v2 - v1) + v1);\
if(weighted_cdf[pos + 1] - weighted_cdf[pos] > kEpsilon){\
return static_cast<T>((threshold - weighted_cdf[pos]) / (weighted_cdf[pos + 1] - weighted_cdf[pos]) * (v2 - v1) + v1); \
} else {\
return static_cast<T>(v2);\
}\
}\
}\
/*!
/*!
...
...
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