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
dc584070
Unverified
Commit
dc584070
authored
Oct 09, 2019
by
Guolin Ke
Committed by
GitHub
Oct 09, 2019
Browse files
fix bug in parser
parent
fdb39237
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
src/io/parser.cpp
src/io/parser.cpp
+27
-24
No files found.
src/io/parser.cpp
View file @
dc584070
...
...
@@ -112,7 +112,10 @@ std::vector<std::string> ReadKLineFromFile(const char* filename, bool header, in
for
(
int
i
=
0
;
i
<
k
;
++
i
)
{
if
(
!
tmp_file
.
eof
())
{
GetLine
(
&
tmp_file
,
&
cur_line
,
reader
.
get
(),
&
buffer
,
buffer_size
);
cur_line
=
Common
::
Trim
(
cur_line
);
if
(
!
cur_line
.
empty
())
{
ret
.
push_back
(
cur_line
);
}
}
else
{
break
;
}
...
...
@@ -142,7 +145,7 @@ DataType GetDataType(const std::vector<std::string>& lines, int* num_col) {
}
else
if
(
comma_cnt
>
0
)
{
type
=
DataType
::
CSV
;
}
}
}
else
if
(
lines
.
size
()
>
1
)
{
int
comma_cnt2
=
0
;
int
tab_cnt2
=
0
;
int
colon_cnt2
=
0
;
...
...
@@ -167,7 +170,7 @@ DataType GetDataType(const std::vector<std::string>& lines, int* num_col) {
}
}
}
}
if
(
type
==
DataType
::
LIBSVM
)
{
int
max_col_idx
=
0
;
for
(
size_t
i
=
0
;
i
<
lines
.
size
();
++
i
)
{
...
...
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