Unverified Commit 1cc84b35 authored by Jacob Stevenson's avatar Jacob Stevenson Committed by GitHub
Browse files

[python] Improve error message for plot_metric with Booster (#4709)

* Improve error message for plot_metric with Booster

* Update error message
parent f4970686
......@@ -342,6 +342,8 @@ def plot_metric(
eval_results = deepcopy(booster.evals_result_)
elif isinstance(booster, dict):
eval_results = deepcopy(booster)
elif isinstance(booster, Booster):
raise TypeError("booster must be dict or LGBMModel. To use plot_metric with Booster type, first record the metrics using record_evaluation callback then pass that to plot_metric as argument `booster`")
else:
raise TypeError('booster must be dict or LGBMModel.')
......
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