mljar / supertree

Visualize decision trees in Python
https://mljar.com/supertree
GNU Affero General Public License v3.0
404 stars 9 forks source link

Multiple targets and overall HTML #12

Closed Kirvyteo closed 1 month ago

Kirvyteo commented 1 month ago

Thanks for sharing this project. I really like the visualization. I tested it with xgboost and I have a few questions and thoughts

  1. Since many trees are used, it generated multiple htmls, one for each tree. (We have 100 trees) Is there an overall tree that summarizes the outcome?

  2. I am seeing multiple targets in 1 circle. How do I interpret this? image

thanks!

Marchlak commented 1 month ago

Thank you for your kind words and for trying out the visualization! I'm glad to hear you found it useful. Let me address your questions:

In the case of XGBoost, there isn’t a single tree that summarizes all the trees in the model. XGBoost is an ensemble method, meaning it builds multiple decision trees (in your case, 100), and the final prediction is a result of combining the outputs of all these trees. Unfortunately, there’s no single "overall tree" that can capture the entire model’s output, as each tree contributes in a different way to the final result.

Regarding the multiple targets in one circle, this represents how many samples of a particular class have passed through to that specific leaf. It’s possible for more than one target class to end up at the same leaf.

Thank you again for your feedback! If you have any other questions or need further clarification, feel free to reach out.