File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11# License: BSD 3-Clause
22from __future__ import annotations
33
4+ import importlib .util
45from typing import TYPE_CHECKING , Any
56
67# Need to implement the following by its full path because otherwise it won't be possible to
1617SKLEARN_HINT = (
1718 "But it looks related to scikit-learn. "
1819 "Please install the OpenML scikit-learn extension (openml-sklearn) and try again. "
20+ "You can use `pip install openml-sklearn` for installation."
1921 "For more information, see "
20- "https://github.com/ openml/openml-sklearn?tab=readme-ov-file#installation "
22+ "https://docs. openml.org/python/extensions/ "
2123)
2224
2325
@@ -58,6 +60,10 @@ def get_extension_by_flow(
5860 -------
5961 Extension or None
6062 """
63+ # import openml_sklearn to register SklearnExtension
64+ if importlib .util .find_spec ("openml_sklearn" ):
65+ import openml_sklearn # noqa: F401
66+
6167 candidates = []
6268 for extension_class in openml .extensions .extensions :
6369 if extension_class .can_handle_flow (flow ):
@@ -103,6 +109,10 @@ def get_extension_by_model(
103109 -------
104110 Extension or None
105111 """
112+ # import openml_sklearn to register SklearnExtension
113+ if importlib .util .find_spec ("openml_sklearn" ):
114+ import openml_sklearn # noqa: F401
115+
106116 candidates = []
107117 for extension_class in openml .extensions .extensions :
108118 if extension_class .can_handle_model (model ):
You can’t perform that action at this time.
0 commit comments