From c4ec9a4939894885d8ec9eee8dd1911c62d40107 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 16 Sep 2024 11:32:51 -0500 Subject: [PATCH] move comment --- python-package/lightgbm/sklearn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index fa42dff54..fe97053a4 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -662,6 +662,10 @@ class LGBMModel(_LGBMModelBase): 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, @@ -674,10 +678,6 @@ class LGBMModel(_LGBMModelBase): } 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"]