[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
|
||||
) -> None:
|
||||
if not SKLEARN_INSTALLED:
|
||||
raise XGBoostError(
|
||||
raise ImportError(
|
||||
"sklearn needs to be installed in order to use this module"
|
||||
)
|
||||
self.n_estimators = n_estimators
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user