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
71b6550f
Unverified
Commit
71b6550f
authored
Aug 29, 2022
by
James Lamb
Committed by
GitHub
Aug 29, 2022
Browse files
[python-package] add type hints on empty initializations (#5445)
parent
465989f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+3
-3
python-package/lightgbm/engine.py
python-package/lightgbm/engine.py
+1
-1
No files found.
python-package/lightgbm/basic.py
View file @
71b6550f
...
...
@@ -2514,7 +2514,7 @@ class Dataset:
Chain of references of the Datasets.
"""
head
=
self
ref_chain
=
set
()
ref_chain
:
Set
[
Dataset
]
=
set
()
while
len
(
ref_chain
)
<
ref_limit
:
if
isinstance
(
head
,
Dataset
):
ref_chain
.
add
(
head
)
...
...
@@ -2733,8 +2733,8 @@ class Booster:
ctypes
.
byref
(
self
.
handle
)))
# save reference to data
self
.
train_set
=
train_set
self
.
valid_sets
=
[]
self
.
name_valid_sets
=
[]
self
.
valid_sets
:
List
[
Dataset
]
=
[]
self
.
name_valid_sets
:
List
[
str
]
=
[]
self
.
__num_dataset
=
1
self
.
__init_predictor
=
train_set
.
_predictor
if
self
.
__init_predictor
is
not
None
:
...
...
python-package/lightgbm/engine.py
View file @
71b6550f
...
...
@@ -300,7 +300,7 @@ class CVBooster:
model_file : str, pathlib.Path or None, optional (default=None)
Path to the CVBooster model file.
"""
self
.
boosters
=
[]
self
.
boosters
:
List
[
Booster
]
=
[]
self
.
best_iteration
=
-
1
if
model_file
is
not
None
:
...
...
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