Question

Sklearn decision tree rules

  • 13 April 2022
  • 2 replies
  • 43 views

Userlevel 3
Badge +1
  • Active Contributor
  • 5 replies

Does anyone has/knows a library that extracts a sklearn decision tree into rules/present each rule with its number of samples? The idea is present small rules that have an impact on the likelihood of a customer returning and time between purchases.


2 replies

Userlevel 3
Badge +1

I know you can plot a tree like this. https://scikit-learn.org/stable/modules/generated/sklearn.tree.plot_tree.html
I presume there would be a way to extract the rules in a similar way?

Userlevel 3
Badge +1

Thanks Tom! I’ll give this a try!

Reply