Simple One-Liners to Preview a Decision Tree Using Sklearn

If you want to preview a decision tree, sklearn provides two simple methods to do so.

1. 𝐩𝐥𝐨𝐭_𝐭𝐫𝐞𝐞 creates a graphical representation of a decision tree.

2. 𝐞𝐱𝐩𝐨𝐫𝐭_𝐭𝐞𝐱𝐭 builds a text report showing the rules of a decision tree.

This is typically used to understand the rules learned by a decision tree and gaining a better understanding of the behavior of a decision tree model.

Share this post on LinkedIn: Post Link.

Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

Reply

or to participate.