num_leaves vs tree_depth in lgbm
Athospd opened this issue · 2 comments
Athospd commented
- {parsnip} do not offer
num_leaves
as a hiperparameter. Onlytree_depth
- {lightgbm} demands
num_leaves
to be passed. num_leaves
do not have a default, but the doc shows suggestions. For a tree to be ruled only bytree_depth
,num_leaves
should be equal to2^(tree_depth) - 1
.- When
tree_depth
> 17, lightgbm throws the following error:
Error in lgb.call("LGBM_DatasetCreateFromMat_R", ret = handle, private$raw_data, :
[LightGBM] [Fatal] Check failed: (num_leaves) <= (131072)
Athospd commented
I put a warning when tree_depth > 17, but I really don't know if it is needed nor it is in the right way.
dfalbel commented
I think that's totally fine. I don't think it's common to use tree_depth > 10.