Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Bagging in LightGBM works

In the lightGBM model, there are 2 parameters related to bagging

bagging_fraction
bagging_freq (frequency for bagging
              0 means disable bagging; k means perform bagging at every k 
              iteration
              Note: to enable bagging, bagging_fraction should be set to 
              value smaller than 1.0 as well)

I could find some more detailed explanation about this bagging function in gdbt. So is there anybody give me a more detailed explaination?

like image 573
Kid Avatar asked Nov 30 '18 07:11

Kid


1 Answers

The code executes what documentation says- it samples a subset of training examples of the size bagging_fraction * N_train_examples. And training of the i-th tree is performed on this subset. This sampling can be done for each tree (i.e. each iteration) or after each bagging_freq trees have been trained.

For example, bagging_fraction=0.5, bagging_freq=10 means that sampling of new 0.5*N_train_examples entries will happen every 10 iterations

like image 154
Mischa Lisovyi Avatar answered Nov 18 '22 07:11

Mischa Lisovyi