diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index 5ebfed0cd87d..7c31255f4c4b 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -15,31 +15,30 @@ pd_DataFrame, pd_Series) from .engine import train -_ArrayLike = Union[np.ndarray, ss.spmatrix, pd_Series] +_ArrayLike = Union[List, np.ndarray, pd_Series] _EvalResultType = Tuple[str, float, bool] -_GroupType = Union[_ArrayLike, List[int]] _LGBM_ScikitCustomObjectiveFunction = Union[ Callable[ - [_ArrayLike, _ArrayLike], + [_ArrayLike, np.ndarray], Tuple[np.ndarray, np.ndarray] ], Callable[ - [_ArrayLike, _ArrayLike, _GroupType], + [_ArrayLike, np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray] ], ] _LGBM_ScikitCustomEvalFunction = Union[ Callable[ - [_ArrayLike, _ArrayLike], + [_ArrayLike, np.ndarray], Union[_EvalResultType, List[_EvalResultType]] ], Callable[ - [_ArrayLike, _ArrayLike, _ArrayLike], + [_ArrayLike, np.ndarray, np.ndarray], Union[_EvalResultType, List[_EvalResultType]] ], Callable[ - [_ArrayLike, _ArrayLike, _ArrayLike, _GroupType], + [_ArrayLike, np.ndarray, np.ndarray, np.ndarray], Union[_EvalResultType, List[_EvalResultType]] ], ]