Skip to content

Commit

Permalink
update type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 8, 2021
1 parent 9d00c4c commit ea1aada
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
],
]
Expand Down

0 comments on commit ea1aada

Please sign in to comment.