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
c2ba086c
Commit
c2ba086c
authored
Jan 10, 2017
by
Guolin Ke
Browse files
fix bug in sparse bin iterator
parent
3ef3a489
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+1
-0
src/io/sparse_bin.hpp
src/io/sparse_bin.hpp
+2
-1
No files found.
python-package/lightgbm/basic.py
View file @
c2ba086c
...
...
@@ -90,6 +90,7 @@ def cfloat32_array_to_numpy(cptr, length):
else
:
raise
RuntimeError
(
'Expected float pointer'
)
def
cfloat64_array_to_numpy
(
cptr
,
length
):
"""Convert a ctypes double pointer array to a numpy array.
"""
...
...
src/io/sparse_bin.hpp
View file @
c2ba086c
...
...
@@ -181,6 +181,7 @@ public:
}
void
GetFastIndex
()
{
fast_index_
.
clear
();
// get shift cnt
data_size_t
mod_size
=
(
num_data_
+
kNumFastIndex
-
1
)
/
kNumFastIndex
;
...
...
@@ -195,7 +196,7 @@ public:
data_size_t
cur_pos
=
0
;
data_size_t
next_threshold
=
0
;
while
(
NextNonzero
(
&
i_delta
,
&
cur_pos
))
{
while
(
next_threshold
<
cur_pos
)
{
while
(
next_threshold
<
=
cur_pos
)
{
fast_index_
.
emplace_back
(
i_delta
,
cur_pos
);
next_threshold
+=
pow2_mod_size
;
}
...
...
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