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
78f95e41
Unverified
Commit
78f95e41
authored
Aug 23, 2022
by
James Lamb
Committed by
GitHub
Aug 23, 2022
Browse files
[python-package] add more type hints on Booster (#5432)
parent
865c126a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+9
-9
No files found.
python-package/lightgbm/basic.py
View file @
78f95e41
...
...
@@ -2760,7 +2760,7 @@ class Booster:
booster
=
Booster
(
model_str
=
model_str
)
return
booster
def
__getstate__
(
self
):
def
__getstate__
(
self
)
->
Dict
[
str
,
Any
]
:
this
=
self
.
__dict__
.
copy
()
handle
=
this
[
'handle'
]
this
.
pop
(
'train_set'
,
None
)
...
...
@@ -2769,7 +2769,7 @@ class Booster:
this
[
"handle"
]
=
self
.
model_to_string
(
num_iteration
=-
1
)
return
this
def
__setstate__
(
self
,
state
)
:
def
__setstate__
(
self
,
state
:
Dict
[
str
,
Any
])
->
None
:
model_str
=
state
.
get
(
'handle'
,
None
)
if
model_str
is
not
None
:
handle
=
ctypes
.
c_void_p
()
...
...
@@ -3663,16 +3663,16 @@ class Booster:
self
,
data
,
label
,
decay_rate
=
0.9
,
reference
=
None
,
decay_rate
:
float
=
0.9
,
reference
:
Optional
[
Dataset
]
=
None
,
weight
=
None
,
group
=
None
,
init_score
=
None
,
feature_name
=
'auto'
,
categorical_feature
=
'auto'
,
dataset_params
=
None
,
free_raw_data
=
True
,
validate_features
=
False
,
feature_name
:
Union
[
str
,
List
[
str
]]
=
'auto'
,
categorical_feature
:
Union
[
str
,
List
[
str
],
List
[
int
]]
=
'auto'
,
dataset_params
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
free_raw_data
:
bool
=
True
,
validate_features
:
bool
=
False
,
**
kwargs
):
"""Refit the existing Booster by new data.
...
...
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