catboost icon indicating copy to clipboard operation
catboost copied to clipboard

In binary classification problems, how to know which class the leaf nodes belong to in the images output by plot_tree()?

Open Thegongyx opened this issue 2 years ago • 2 comments

In binary classification problems, how to know which class the leaf nodes belong to in the images output by plot_tree()?

"val" cannot help me confirm the specific class.

Thegongyx avatar Oct 10 '23 02:10 Thegongyx

Values in the leaves do not directly predict classes due to the nature of the gradient boosting (unless your model consists only of a single tree), individual trees are so called "weak learners" that gradually improve our model function.

See https://en.wikipedia.org/wiki/Gradient_boosting#Gradient_tree_boosting.

Rather the sum of values of all leaves that are selected for a particular input feature values for all trees is used as an argument to the sigmoid function that will estimate the positive class probability.

andrey-khropov avatar Aug 19 '24 23:08 andrey-khropov

My model consists only of a single tree; I just want to use the model's visualization feature to analyze whether there are business problems after feature crossing, so I only used one tree. How should I judge the classification of leaf nodes according to the visualization output picture? @andrey-khropov Can the indicator "val" be used as a judgment basis?

Thegongyx avatar Oct 12 '24 08:10 Thegongyx