Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Treebomination: Convert a scikit-learn decision tree into a Keras model (github.com/dobiasd)
79 points by Dobiasd on June 11, 2023 | hide | past | favorite | 6 comments


Just an FYI - you can achieve this in 3 layers. It does not need to be deep. https://github.com/charliec443/TreeGrad


Yeah, this one does something much less insane, i.e., it converts the paths to the tree outputs into their corresponding DNS (disjunctive normal form) and represents each term as a node (side by side in the same layer) in the NN, as described by Arunava Banerjee in "Initializing Neural Networks using Decision" [1]. The resulting NN architecture is much more reasonable than the one that treebomination produces.

[1]: https://www.cise.ufl.edu/~arunava/papers/clnl94.pdf


You can also use Tensorflow decision forest to begin with [1].

[1] https://www.tensorflow.org/decision_forests


Thank! Yes, in contrast to treebomination, using TF-DF can actually make sense. ;)


See also hummingbird [1]

[1]: https://github.com/microsoft/hummingbird


Thanks! This looks interesting. Some of the main differences I can spot so far are: - Hummingbird does not construct a NN with an architecture isomorphic to the source decision tree but instead cleverly compiled it into other (more sane) tensor computations. - Hummingbird is actually useful. ;)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: