XGBoost - AFT - plot_tree() leaf labels

Hello,
I am writing a survival analysis script, using python and xgboost with objective suvival:aft. So far I was following the tutorial and documentation. Everything seems to be working but I would like to present the effect of my work as a tree graph. I am using the plot_tree(model, num_trees) function.
My question is: what are the values plotted in the leaves? I understand, that the whole tree works like a decision tree with decisions based on particular features. In the leaves I have numeric labels, but they don’t seem to be the predictions themselves (I’ve found some negative values in the leaves, which isn’t likely in survival analysis and prediction, right?) - are these some kind of scores or values to be calculated in some way to get the predictions like with the Cox regression?
My second question has to do with the trained trees: I have, for example, 1000 trees. I input some data and get the predictions. Which trees are used by the model for the prediction? Is the predicted value coming from any particular tree or trees (p.e. the last one as it is the best trained or something) or is the prediction a product of all of the model’s trees? Is there a way to present how is the prediction given, based on the plotted trees?

Best Regards,
sokol07

@sokol07

All the 1000 trees are used for prediction.

The sum of the outputs from all the trees represents the log survival time. Since we are in the log scale, negative values are permissible.

For more mathematical details, consult this arXiv paper: https://arxiv.org/abs/2006.04920

@hcho3 Thanks you very much for reply. Just to be sure that I understand correctly:
The prediction can be calculated as:
ln(prediction) = out_tree1 + out_tree2 + ... + out_treeN ?

Yes that is correct.

Thank you very much!

Would you help me understand slightly better how we work out the actual prediction from the sum of the N trees/leaves that we have in the model?

Let’s say we have the model for a binary classification (2 classes, 0 and 1) with N trees.
As mentioned above the sum of the N leaves (one leaf per tree) will give us the probability (0…1) that it has predicted the outcome 1 (that’s after we have applied the inverse logistic to it)?

Do i understand correctly that if that probability is less that 0.5 then the actual prediction is 0 and if the probability is greater than 0.5 then the actual prediction is 1? (or am i talking nonsense)

That’s what i dont understand, how do we map that probability to the classes {0, 1}