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
04e0db00
Commit
04e0db00
authored
Jul 31, 2017
by
j-mark-hou
Committed by
Guolin Ke
Aug 01, 2017
Browse files
now use set instead of list in python package basic.Dataset.get_ref_chain (#758)
parent
399710ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+3
-3
No files found.
python-package/lightgbm/basic.py
View file @
04e0db00
...
@@ -1185,17 +1185,17 @@ class Dataset(object):
...
@@ -1185,17 +1185,17 @@ class Dataset(object):
chain of references of self : set of Dataset objects
chain of references of self : set of Dataset objects
'''
'''
head
=
self
head
=
self
ref_chain
=
[]
ref_chain
=
set
()
while
len
(
ref_chain
)
<
ref_limit
:
while
len
(
ref_chain
)
<
ref_limit
:
if
isinstance
(
head
,
Dataset
):
if
isinstance
(
head
,
Dataset
):
ref_chain
+=
[
head
]
ref_chain
.
add
(
head
)
if
(
head
.
reference
is
not
None
)
and
(
head
.
reference
not
in
ref_chain
):
if
(
head
.
reference
is
not
None
)
and
(
head
.
reference
not
in
ref_chain
):
head
=
head
.
reference
head
=
head
.
reference
else
:
else
:
break
break
else
:
else
:
break
break
return
(
set
(
ref_chain
)
)
return
(
ref_chain
)
class
Booster
(
object
):
class
Booster
(
object
):
...
...
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