Hacker News new | past | comments | ask | show | jobs | submit login
How to Visualize Decision Trees (explained.ai)
272 points by LewisVerstappen on Sept 28, 2021 | hide | past | favorite | 12 comments



And his visualization of constrained optimization is astonishing https://explained.ai/regularization/index.html (I struggled for a long time to get the right intuition of a Lagrangian)


Thanks! Took me a year to discover the key nut there. L1 vs L2 regularization is not well described I found so I went nuts trying to nail it down.


If you're interested, in my thesis I induced l1-regularized decision trees through a boosting style approach. Adding an l1 term and maximizing the gradient led to sparse tree.


Very nice work. Glad to see both classification and regression treated very well, with careful attention to design to make something that is easy to understand.

Now the question is - can we build on this (or do something analogous) for tree ensembles? Random Forests, Gradient Boosted Trees etc. Quite common to use that to gain predictive accuracy, though interpretability/explainability tends to suffer considerably.


Thanks! It took forever to bash my way to victory on that trees. The lib also supports the shallow trees in boosting machines.


Great explanation; I understand different visual tree orientations. I agree with the lesson learned section; it's not about programming alone but also about determining the ecosystem's capabilities.


In the "Default scikit Iris visualization" example you could colorize the arrows for true|false since colors are available.

Alternatively you could use two distinct types of arrowheads.


That's a good idea. thanks!


Also note we recently added 1D and 2D classifier decision boundary plots. See https://github.com/parrt/dtreeviz/blob/master/notebooks/clas...


kudos for the clean HTML document


Thanks. It's morphed over time as we add functionality so it's less clean than before.


nice




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: