Skip to content

Commit

Permalink
[python][sklearn] add __sklearn_is_fitted__() method to be better c…
Browse files Browse the repository at this point in the history
…ompatible with scikit-learn API (#4636)
  • Loading branch information
StrikerRUS authored Oct 5, 2021
1 parent 01aa295 commit 4b140bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ def _more_tags(self):
}
}

def __sklearn_is_fitted__(self) -> bool:
return getattr(self, "fitted_", False)

def get_params(self, deep=True):
"""Get parameters for this estimator.
Expand Down

0 comments on commit 4b140bc

Please sign in to comment.