Skip to content

Commit

Permalink
Fix histogram.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 15, 2021
1 parent 74f2c27 commit 690c221
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python-package/xgboost/core.py
Expand Up @@ -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
Expand Down Expand Up @@ -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."
)
Expand Down

0 comments on commit 690c221

Please sign in to comment.