Skip to content

Commit

Permalink
[python] deprecate "auto" value of ylabel argument of plot_metric() f…
Browse files Browse the repository at this point in the history
…unction (#4624)
  • Loading branch information
StrikerRUS authored Sep 25, 2021
1 parent b78175b commit 74c7904
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python-package/lightgbm/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def plot_metric(
ylim: Optional[Tuple[float, float]] = None,
title: Optional[str] = 'Metric during training',
xlabel: Optional[str] = 'Iterations',
ylabel: Optional[str] = 'auto',
ylabel: Optional[str] = '@metric@',
figsize: Optional[Tuple[float, float]] = None,
dpi: Optional[int] = None,
grid: bool = True
Expand Down Expand Up @@ -316,7 +316,7 @@ def plot_metric(
xlabel : str or None, optional (default="Iterations")
X-axis title label.
If None, title is disabled.
ylabel : str or None, optional (default="auto")
ylabel : str or None, optional (default="@metric@")
Y-axis title label.
If 'auto', metric name is used.
If None, title is disabled.
Expand Down Expand Up @@ -402,6 +402,8 @@ def plot_metric(
ax.set_ylim(ylim)

if ylabel == 'auto':
_log_warning("'auto' value of 'ylabel' argument is deprecated and will be removed in a future release of LightGBM. "
"Use '@metric@' placeholder instead.")
ylabel = '@metric@'

if title is not None:
Expand Down

0 comments on commit 74c7904

Please sign in to comment.