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
66804b93
Commit
66804b93
authored
Oct 31, 2016
by
Guolin Ke
Committed by
GitHub
Oct 31, 2016
Browse files
fixed bug for check having label or not for libsvm
parent
2f984f3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/io/parser.cpp
src/io/parser.cpp
+3
-3
No files found.
src/io/parser.cpp
View file @
66804b93
...
...
@@ -28,10 +28,10 @@ int GetLabelIdxForLibsvm(std::string& str, int num_features, int label_idx) {
str
=
Common
::
Trim
(
str
);
auto
pos_space
=
str
.
find_first_of
(
"
\f\n\r\t\v
"
);
auto
pos_colon
=
str
.
find_first_of
(
":"
);
if
(
pos_colon
==
std
::
string
::
npos
||
pos_colon
>
pos_space
)
{
return
-
1
;
}
else
{
if
(
pos_space
==
std
::
string
::
npos
||
pos_space
<
pos_colon
)
{
return
label_idx
;
}
else
{
return
-
1
;
}
}
...
...
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