Skip to content

Commit

Permalink
[python-package] fix mypy errors about custom eval functions in sklea…
Browse files Browse the repository at this point in the history
…rn.py (#5721)
  • Loading branch information
jameslamb authored Feb 16, 2023
1 parent 74316c1 commit f136de4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ def __init__(self, func: _LGBM_ScikitCustomEvalFunction):
"""
self.func = func

def __call__(self, preds: np.ndarray, dataset: Dataset) -> Tuple[str, float, bool]:
def __call__(
self,
preds: np.ndarray,
dataset: Dataset
) -> Union[_LGBM_EvalFunctionResultType, List[_LGBM_EvalFunctionResultType]]:
"""Call passed function with appropriate arguments.
Parameters
Expand Down

0 comments on commit f136de4

Please sign in to comment.