Closed dtararuj closed 11 months ago
Hey @dtararuj, thanks for using LightGBM. This is due to #5066. Previously the individual boosters in the CVBooster object would keep all training iterations, regardless of what the best iteration was. So for example if early stopping was performed and the best iteration was 5, previously the boosters had 55 rounds (since you set stopping_rounds=50
), which were all saved. Now it's only saving up until the best iteration (5 in this example). If you want to save all of them you can do something like:
for bst in model_1.boosters:
bst.save_model(
f'model_{model_name}_cv{i}.txt',
num_iteration=bst.current_iteration(),
)
ok it makes sense, thank you
Description
Hi, I faced a strange issue. I've tried to create model to predict possitive and negative values as an output. I am using default objectice, and CV with 3 folds.
When I executed code using lgb==3.3.5 I have many more trees in my model file than when I used newer version.
Using newest version i i have one or two tree in the model .txt file, using oldest version many more.
Is it expected behaviour ? Related to this I have also worse accuracy.
Reproducible example