Skip to content

Commit

Permalink
Better xlabel in plot_importance() (#11009)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayer79 authored Nov 21, 2024
1 parent a502f67 commit 2e189a8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-package/xgboost/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def plot_importance(
xlim: Optional[tuple] = None,
ylim: Optional[tuple] = None,
title: str = "Feature importance",
xlabel: str = "F score",
xlabel: str = "Importance score",
ylabel: str = "Features",
fmap: PathLike = "",
importance_type: str = "weight",
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_plotting(self):
ax = xgb.plot_importance(booster)
assert isinstance(ax, Axes)
assert ax.get_title() == 'Feature importance'
assert ax.get_xlabel() == 'F score'
assert ax.get_xlabel() == 'Importance score'
assert ax.get_ylabel() == 'Features'
assert len(ax.patches) == 4

Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_with_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def test_sklearn_plotting():
ax = xgb.plot_importance(classifier)
assert isinstance(ax, Axes)
assert ax.get_title() == 'Feature importance'
assert ax.get_xlabel() == 'F score'
assert ax.get_xlabel() == 'Importance score'
assert ax.get_ylabel() == 'Features'
assert len(ax.patches) == 4

Expand Down

0 comments on commit 2e189a8

Please sign in to comment.