[skl] Enable cat feature without specifying tree method. (#9353)

This commit is contained in:
Jiaming Yuan
2023-07-03 22:06:17 +08:00
committed by GitHub
parent 39390cc2ee
commit e964654b8f
3 changed files with 5 additions and 7 deletions

View File

@@ -930,8 +930,7 @@ class XGBModel(XGBModelBase):
callbacks = self.callbacks if self.callbacks is not None else callbacks
tree_method = params.get("tree_method", None)
cat_support = {"gpu_hist", "approx", "hist"}
if self.enable_categorical and tree_method not in cat_support:
if self.enable_categorical and tree_method == "exact":
raise ValueError(
"Experimental support for categorical data is not implemented for"
" current tree method yet."