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
86ec0ef2
Commit
86ec0ef2
authored
Sep 03, 2018
by
Sixiang Hu
Committed by
Guolin Ke
Sep 03, 2018
Browse files
truncation for TweedieMetric class (#1625)
parent
677716d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/metric/regression_metric.hpp
src/metric/regression_metric.hpp
+4
-0
No files found.
src/metric/regression_metric.hpp
View file @
86ec0ef2
...
@@ -286,6 +286,10 @@ public:
...
@@ -286,6 +286,10 @@ public:
inline
static
double
LossOnPoint
(
label_t
label
,
double
score
,
const
Config
&
config
)
{
inline
static
double
LossOnPoint
(
label_t
label
,
double
score
,
const
Config
&
config
)
{
const
double
rho
=
config
.
tweedie_variance_power
;
const
double
rho
=
config
.
tweedie_variance_power
;
const
double
eps
=
1e-10
f
;
if
(
score
<
eps
)
{
score
=
eps
;
}
const
double
a
=
label
*
std
::
exp
((
1
-
rho
)
*
std
::
log
(
score
))
/
(
1
-
rho
);
const
double
a
=
label
*
std
::
exp
((
1
-
rho
)
*
std
::
log
(
score
))
/
(
1
-
rho
);
const
double
b
=
std
::
exp
((
2
-
rho
)
*
std
::
log
(
score
))
/
(
2
-
rho
);
const
double
b
=
std
::
exp
((
2
-
rho
)
*
std
::
log
(
score
))
/
(
2
-
rho
);
return
-
a
+
b
;
return
-
a
+
b
;
...
...
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