Unverified Commit 27e69e75 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] add type hints on label (#5754)

parent e666a4b4
...@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment