From 608d51da370bcf2905a72d1b2ae375ab1165b558 Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Fri, 9 Dec 2022 16:31:07 -0500 Subject: [PATCH] watchlist arguments should respect verbosity (#27) --- Project.toml | 2 +- src/MLJXGBoostInterface.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d39440d..fdc5330 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJXGBoostInterface" uuid = "54119dfa-1dab-4055-a167-80440f4f7a91" authors = ["Anthony D. Blaom "] -version = "0.3.2" +version = "0.3.3" [deps] MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" diff --git a/src/MLJXGBoostInterface.jl b/src/MLJXGBoostInterface.jl index 18bd7f1..eac3829 100644 --- a/src/MLJXGBoostInterface.jl +++ b/src/MLJXGBoostInterface.jl @@ -105,6 +105,9 @@ function kwargs(model, verbosity, obj) fn = filter(∉(excluded), fieldnames(typeof(model))) o = NamedTuple(n=>getfield(model, n) for n ∈ fn if !isnothing(getfield(model, n))) o = merge(o, (silent=(verbosity ≤ 0),)) + # watchlist is for log output, so override if it's default and verbosity ≤ 0 + wl = (verbosity ≤ 0 && isnothing(model.watchlist)) ? (;) : model.watchlist + o = merge(o, (watchlist=wl,)) merge(o, (objective=_fix_objective(obj),)) end