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
27e69e75
Unverified
Commit
27e69e75
authored
Feb 28, 2023
by
James Lamb
Committed by
GitHub
Feb 28, 2023
Browse files
[python-package] add type hints on label (#5754)
parent
e666a4b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+6
-2
No files found.
python-package/lightgbm/basic.py
View file @
27e69e75
...
@@ -262,7 +262,11 @@ def _is_1d_collection(data: Any) -> bool:
...
@@ -262,7 +262,11 @@ def _is_1d_collection(data: Any) -> bool:
)
)
def
_list_to_1d_numpy
(
data
,
dtype
=
np
.
float32
,
name
=
'list'
):
def
_list_to_1d_numpy
(
data
:
Any
,
dtype
=
np
.
float32
,
name
:
str
=
'list'
)
->
np
.
ndarray
:
"""Convert data to numpy 1-D array."""
"""Convert data to numpy 1-D array."""
if
_is_numpy_1d_array
(
data
):
if
_is_numpy_1d_array
(
data
):
return
_cast_numpy_array_to_dtype
(
data
,
dtype
)
return
_cast_numpy_array_to_dtype
(
data
,
dtype
)
...
@@ -4055,7 +4059,7 @@ class Booster:
...
@@ -4055,7 +4059,7 @@ class Booster:
def
refit
(
def
refit
(
self
,
self
,
data
:
_LGBM_TrainDataType
,
data
:
_LGBM_TrainDataType
,
label
,
label
:
_LGBM_LabelType
,
decay_rate
:
float
=
0.9
,
decay_rate
:
float
=
0.9
,
reference
:
Optional
[
Dataset
]
=
None
,
reference
:
Optional
[
Dataset
]
=
None
,
weight
:
Optional
[
_LGBM_WeightType
]
=
None
,
weight
:
Optional
[
_LGBM_WeightType
]
=
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