Discover more from Daily Dose of Data Science
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.
Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new about Python and Data Science every day.
Find the code for my tips here: GitHub.