diff --git a/python-package/lightgbm/sklearn_compat.py b/python-package/lightgbm/_sklearn_compat.py similarity index 99% rename from python-package/lightgbm/sklearn_compat.py rename to python-package/lightgbm/_sklearn_compat.py index e79ce2511900..c1414f1daf5d 100644 --- a/python-package/lightgbm/sklearn_compat.py +++ b/python-package/lightgbm/_sklearn_compat.py @@ -1,3 +1,4 @@ +# coding: utf-8 """Ease developer experience to support multiple versions of scikit-learn. This file is intended to be vendored in your project if you do not want to depend on diff --git a/python-package/lightgbm/compat.py b/python-package/lightgbm/compat.py index d0420ed9a543..45650a93f1a5 100644 --- a/python-package/lightgbm/compat.py +++ b/python-package/lightgbm/compat.py @@ -16,7 +16,7 @@ from sklearn.exceptions import NotFittedError from sklearn.model_selection import BaseCrossValidator, GroupKFold, StratifiedKFold from sklearn.utils.validation import _check_sample_weight - from .sklearn_compat.utils.validation import validate_data + from ._sklearn_compat import validate_data SKLEARN_INSTALLED = True _LGBMBaseCrossValidator = BaseCrossValidator @@ -65,7 +65,7 @@ class _LGBMRegressorBase: # type: ignore # additional scikit-learn imports only for type hints if TYPE_CHECKING: - from .sklearn_compat.utils import Tags as _sklearn_Tags # noqa: F401 + from ._sklearn_compat import Tags as _sklearn_Tags # noqa: F401 """pandas""" try: