How fix initial trees without features into get_booster().get_dump()?


The xgb.get_booster().get_dump() shows that some of individual trees are empty (no variable printed - only constants).



The mean of your response variable appears to be a lot lower than 0.5 (which is the default base_score in XGBoost), so the algorithm has determined that the best thing to do for the first four trees is not to make any splits but just take the mean of all the observations as the single leaf weight. This is not a problem with XGBoost. Try to run again but this time set base_score equal to the (weighted) mean of your training response variable.


Thank you a lot!
Now I’ve realized all.