bonsai 0.2.0
- Enabled bagging with lightgbm via the
sample_size
argument toboost_tree
(#32 and tidymodels/parsnip#768). The following docs now available in?details_boost_tree_lightgbm
describe the interface in detail:
The
sample_size
argument is translated to thebagging_fraction
parameter in theparam
argument oflgb.train
. The argument is interpreted by lightgbm as a proportion rather than a count, so bonsai internally reparameterizes thesample_size
argument with [dials::sample_prop()] during tuning.To effectively enable bagging, the user would also need to set the
bagging_freq
argument to lightgbm.bagging_freq
defaults to 0, which means bagging is disabled, and abagging_freq
argument ofk
means that the booster will perform bagging at everyk
th boosting iteration. Thus, by default, thesample_size
argument would be ignored without setting this argument manually. Other boosting libraries, like xgboost, do not have an analogous argument tobagging_freq
and usek = 1
when the analogue tobagging_fraction
is in$(0, 1)$ . bonsai will thus automatically setbagging_freq = 1
inset_engine("lightgbm", ...)
ifsample_size
(i.e.bagging_fraction
) is not equal to 1 and nobagging_freq
value is supplied. This default can be overridden by setting thebagging_freq
argument toset_engine()
manually.
-
Corrected mapping of the
mtry
argument inboost_tree
with the lightgbm engine.mtry
previously mapped to thefeature_fraction
argument tolgb.train
but was documented as mapping to an argument more closely resemblingfeature_fraction_bynode
.mtry
now maps tofeature_fraction_bynode
.This means that code that set
feature_fraction_bynode
as an argument toset_engine()
will now error, and the user can now passfeature_fraction
toset_engine()
without raising an error. -
Fixed error in lightgbm with engine argument
objective = "tweedie"
and response values less than 1. -
A number of documentation improvements, increases in testing coverage, and changes to internals in anticipation of the 4.0.0 release of the lightgbm package. Thank you to
@jameslamb
for the effort and expertise!