Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] deprecate "auto" value of ylabel argument of plot_metric() function #4624

Merged
merged 1 commit into from
Sep 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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