Skip to content

Commit

Permalink
move comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 16, 2024
1 parent d715311 commit c4ec9a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ def __init__(
self._n_classes: int = -1
self.set_params(**kwargs)

# scikit-learn 1.6 introduced an __sklearn__tags() method intended to replace _more_tags().
# _more_tags() can be removed whenever lightgbm's minimum supported scikit-learn version
# is >=1.6.
# ref: https://github.com/microsoft/LightGBM/pull/6651
def _more_tags(self) -> Dict[str, Any]:
return {
"allow_nan": True,
Expand All @@ -674,10 +678,6 @@ def _more_tags(self) -> Dict[str, Any]:
}

def __sklearn_tags__(self):
# scikit-learn 1.6 introduced an __sklearn__tags() method intended to replace _more_tags().
# _more_tags() can be removed whenever lightgbm's minimum supported scikit-learn version
# is >=1.6.
# ref: https://github.com/microsoft/LightGBM/pull/6651
tags = super().__sklearn_tags__()
more_tags = self._more_tags()
tags.input_tags.allow_nan = more_tags["allow_nan"]
Expand Down

0 comments on commit c4ec9a4

Please sign in to comment.