Closed Steviey closed 2 years ago
Thanks for using {lightgbm}
! We'd be happy to help you, but we need more information than you've provided.
Can you please provide a minimal, reproducible example? In addition to the code you're running, that should include:
sessionInfo()
{lightgbm}
(e.g. CRAN? built from source?)This information is necessary for maintainers to assist you and try to reproduce the behavior you're seeing.
I actually want to know, how to suppress this message in R.
Here's a minimal, reproducible example showing one way to train a LightGBM model in R and suppress all warning-level log messages.
library(lightgbm)
dtrain <- lightgbm::lgb.Dataset(
data = matrix(rnorm(1000L), ncol = 4L)
, label = rnorm(250L)
)
# produces logs, including "No further splits with positive gain"
bst <- lightgbm::lgb.train(
data = dtrain
, nrounds = 5L
, obj = "regression_l2"
)
# no logs
bst <- lightgbm::lgb.train(
data = dtrain
, nrounds = 5L
, obj = "regression_l2"
, verbose = -1L
)
I installed {lightgbm}
v3.3.2 from CRAN with install.packages()
.
We'd be happy to help you, but cannot unless you provide this type of information.
I see- that's enough info. Then it's highly likely to be a third party issue (tidymodels or treesnip). thx.
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.
R latest, tidymodels latest, lightGbm latest
This message...
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
... is occupying the whole screen, while training, even with 'verbose=-1'.it drives me nuts
model_spec <- boost_tree( trees = as.numeric(resObj$bestParams$trees) ,tree_depth = as.numeric(resObj$bestParams$tree_depth) ,min_n = as.numeric(resObj$bestParams$min_n) ) %>% set_mode("regression") %>% set_engine("lightgbm", objective = "rmse",verbose=-1)
Any ideas?