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
eb027e1b
Unverified
Commit
eb027e1b
authored
Mar 22, 2020
by
Alberto Ferreira
Committed by
GitHub
Mar 22, 2020
Browse files
[fix] Fix IsZero in tree.h (#2932)
Co-authored-by:
Alberto Ferreira
<
alberto.ferreira@feedzai.com
>
parent
8d43356a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
include/LightGBM/tree.h
include/LightGBM/tree.h
+2
-10
No files found.
include/LightGBM/tree.h
View file @
eb027e1b
...
...
@@ -196,19 +196,11 @@ class Tree {
std
::
string
ToIfElse
(
int
index
,
bool
predict_leaf_index
)
const
;
inline
static
bool
IsZero
(
double
fval
)
{
if
(
fval
>
-
kZeroThreshold
&&
fval
<=
kZeroThreshold
)
{
return
true
;
}
else
{
return
false
;
}
return
(
fval
>=
-
kZeroThreshold
&&
fval
<=
kZeroThreshold
);
}
inline
static
double
MaybeRoundToZero
(
double
fval
)
{
if
(
fval
>
-
kZeroThreshold
&&
fval
<=
kZeroThreshold
)
{
return
0
;
}
else
{
return
fval
;
}
return
IsZero
(
fval
)
?
0
:
fval
;
}
inline
static
bool
GetDecisionType
(
int8_t
decision_type
,
int8_t
mask
)
{
...
...
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