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
9ba0cc78
Commit
9ba0cc78
authored
Nov 16, 2017
by
zhangjin
Committed by
Guolin Ke
Nov 16, 2017
Browse files
add 'null' to missing value (#1064)
add 'null' to missing value
parent
e5eb8560
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
include/LightGBM/utils/common.h
include/LightGBM/utils/common.h
+2
-1
No files found.
include/LightGBM/utils/common.h
View file @
9ba0cc78
...
...
@@ -248,7 +248,8 @@ inline static const char* Atof(const char* p, double* out) {
if
(
cnt
>
0
)
{
std
::
string
tmp_str
(
p
,
cnt
);
std
::
transform
(
tmp_str
.
begin
(),
tmp_str
.
end
(),
tmp_str
.
begin
(),
Common
::
tolower
);
if
(
tmp_str
==
std
::
string
(
"na"
)
||
tmp_str
==
std
::
string
(
"nan"
))
{
if
(
tmp_str
==
std
::
string
(
"na"
)
||
tmp_str
==
std
::
string
(
"nan"
)
||
tmp_str
==
std
::
string
(
"null"
))
{
*
out
=
NAN
;
}
else
if
(
tmp_str
==
std
::
string
(
"inf"
)
||
tmp_str
==
std
::
string
(
"infinity"
))
{
*
out
=
sign
*
1e308
;
...
...
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