Can I print the decision path of model?


I trained a model and I want to know how the prediction value determined by model.

Ex: I can see test_X goes which branch, which leaf…etc.

I tried XGBRegressor.apply(test_X), but it seems return the leaf node.


You’ll have to get the dump of the tree and calculate the full path from each leaf prediction.