XGBoost interpretation of the plot in R I am applying XGBoost implementation in R on the data with 9 columns. After training the model, I tried to plot the "multiple-in-one" tree using the xgb.plot.multi.trees() function with the following code:
graph = xgb.plot.multi.trees(model = xgb_model)
graph

I got the following tree:

Could anyone explain the meaning of the Leafs and the number in the brackets (how are they calculated), please?
Many thanks in advance!
 A: XGBoost creates an ensemble of binary trees, which are built "on top of each other". I.e. you first try to find a binary tree that best approximates your data. Then you build further trees that try to represent the residuals of the previous stage. This continues. But those "stacked" trees can obviously also be considered as a single, non-binary tree, and this "master" tree is what the function tries to visualize.
Even though you have nine features, you chose to use the default setting for the option features_keep, which is 5, so the visualization is only displaying the 5 most important features. E.g., for the first tree, those are the features 5,4,1,2,7. The floats behind the feature numbers are the splits where the binary tree changes its value. So the first tree has its split for the fifth feature at 60.320557, for the fourth feature at 7.634660, and so on.
The splitting of the features goes on in further levels, until further splitting is considered futile and a leaf is reached. This is then indicated by the word "Leaf". Behind the word "Leaf" you find, in parenthesis, the actual value of your tree in this leaf.
Thus, I would recommend to rerun the visualization, but this time with features_keep=9 set to your full number of 9 features, and then you can start with some x-value and walk through the tree from left to right, respecting the splits, to see what y-value is assigned in the belonging final leaf.
