diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 7d4105ba15fe..7b28d7ea2e52 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -2474,8 +2474,13 @@ def _validate_features(self, data: DMatrix): raise ValueError(msg.format(self.feature_names, data.feature_names)) - def get_split_value_histogram(self, feature, fmap='', bins=None, - as_pandas=True): + def get_split_value_histogram( + self, + feature: str, + fmap: Union[os.PathLike, str] = '', + bins: Optional[int] = None, + as_pandas: bool = True + ): """Get split value histogram of a feature Parameters @@ -2523,7 +2528,7 @@ def get_split_value_histogram(self, feature, fmap='', bins=None, except (ValueError, AttributeError, TypeError): # None.index: attr err, None[0]: type err, fn.index(-1): value err feature_t = None - if feature_t == "categorical": + if feature_t == "c": # categorical raise ValueError( "Split value historgam doesn't support categorical split." )