You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently discovered that LightGBM has a multiclassova objective function (multi-class one-vs-all) that treats multi-class classification as a set of binary classification tasks. Getting quite decent results with this approach when passed directly to lightgbm::lgb.train(), but I'm not sure if the internal process_objective_function() overrides any objective function manually inserted in set_engine(), for example:
Thanks for the issue! You can set lightgbm params by passing the desired parameter directly to set_engine() rather than as an element of set_engine(param):
library(bonsai)
#> Loading required package: parsnipmtcars$gear<- as.factor(mtcars$gear)
spec<-
boost_tree(mode="classification", engine="lightgbm") %>%
set_engine("lightgbm", objective="multiclassova", num_classes= length(unique(mtcars$gear)))
fit(spec, gear~., mtcars)
#> parsnip model object#> #> LightGBM Model (1 tree)#> Objective: multiclassova (3 classes)#> Fitted to dataset with 10 columns
I recently discovered that LightGBM has a
multiclassova
objective function (multi-class one-vs-all) that treats multi-class classification as a set of binary classification tasks. Getting quite decent results with this approach when passed directly tolightgbm::lgb.train()
, but I'm not sure if the internalprocess_objective_function()
overrides any objective function manually inserted inset_engine()
, for example:set_engine("lightgbm", params = list(objective = "multiclassova"))
Thanks for your help!
The text was updated successfully, but these errors were encountered: