[py-sckl] Raise import error if skl is not installed. (#8049)
This commit is contained in:
parent
794cbaa60a
commit
701f32b227
@ -547,7 +547,7 @@ class XGBModel(XGBModelBase):
|
|||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None:
|
) -> None:
|
||||||
if not SKLEARN_INSTALLED:
|
if not SKLEARN_INSTALLED:
|
||||||
raise XGBoostError(
|
raise ImportError(
|
||||||
"sklearn needs to be installed in order to use this module"
|
"sklearn needs to be installed in order to use this module"
|
||||||
)
|
)
|
||||||
self.n_estimators = n_estimators
|
self.n_estimators = n_estimators
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user