Unverified Commit 74c7904b authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

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

parent b78175b7
...@@ -285,7 +285,7 @@ def plot_metric( ...@@ -285,7 +285,7 @@ def plot_metric(
ylim: Optional[Tuple[float, float]] = None, ylim: Optional[Tuple[float, float]] = None,
title: Optional[str] = 'Metric during training', title: Optional[str] = 'Metric during training',
xlabel: Optional[str] = 'Iterations', xlabel: Optional[str] = 'Iterations',
ylabel: Optional[str] = 'auto', ylabel: Optional[str] = '@metric@',
figsize: Optional[Tuple[float, float]] = None, figsize: Optional[Tuple[float, float]] = None,
dpi: Optional[int] = None, dpi: Optional[int] = None,
grid: bool = True grid: bool = True
...@@ -316,7 +316,7 @@ def plot_metric( ...@@ -316,7 +316,7 @@ def plot_metric(
xlabel : str or None, optional (default="Iterations") xlabel : str or None, optional (default="Iterations")
X-axis title label. X-axis title label.
If None, title is disabled. If None, title is disabled.
ylabel : str or None, optional (default="auto") ylabel : str or None, optional (default="@metric@")
Y-axis title label. Y-axis title label.
If 'auto', metric name is used. If 'auto', metric name is used.
If None, title is disabled. If None, title is disabled.
...@@ -402,6 +402,8 @@ def plot_metric( ...@@ -402,6 +402,8 @@ def plot_metric(
ax.set_ylim(ylim) ax.set_ylim(ylim)
if ylabel == 'auto': 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@' ylabel = '@metric@'
if title is not None: if title is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment