I'm trying to extract exact tree structure of trees constructed by Light GBM algorithm. I've used model_dump
for this and I've extracted structure successfully. The tree looks like this (trained on iris dataset):
I'm having trouble with understanding how to evaluate this tree. Another topic on Stack Overflow says that leaf value is raw prob. before sigmoid. It seems perfectly logical but when I tried to put this value in sigmoid function, probabilities returned by lightgbm.predict(...)
were different than probabilities calculated based on my tree. Is there any postprocessing hidden inside before model_dump
that affects those values? What is the correct way to calculate output prob. from those trees.
Iris dataset is multiclass classification. The tree you are showing us is for one class. Depending on the objective you are using, the postprocessing is not always sigmoid. For multiclass, you need to apply softmax function to your raw predictions.