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
a495a877
Commit
a495a877
authored
Dec 18, 2016
by
Guolin Ke
Browse files
fix get_group in python-package
parent
cbc56c74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+6
-0
No files found.
python-package/lightgbm/basic.py
View file @
a495a877
...
@@ -1148,6 +1148,12 @@ class Dataset(object):
...
@@ -1148,6 +1148,12 @@ class Dataset(object):
"""
"""
if
self
.
group
is
None
and
self
.
__is_constructed
():
if
self
.
group
is
None
and
self
.
__is_constructed
():
self
.
group
=
self
.
inner_dataset
.
get_group
()
self
.
group
=
self
.
inner_dataset
.
get_group
()
if
self
.
group
is
not
None
:
# group data from LightGBM is boundaries data, need to convert to group size
new_group
=
[]
for
i
in
range
(
len
(
self
.
group
)
-
1
):
new_group
.
append
(
self
.
group
[
i
+
1
]
-
self
.
group
[
i
])
self
.
group
=
new_group
return
self
.
group
return
self
.
group
def
num_data
(
self
):
def
num_data
(
self
):
...
...
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