In Machine Learning, a decision tree is a decision support tool that uses a graphical or tree model of decisions and their possible consequences, including the results of random events, resource costs, and utility. This is a way of displaying an algorithm that contains only conditional control statements. In this article, I will take you through how we can visualize a decision tree using Python.

Visualizing a Decision tree is very much different from the visualization of data where we have used a decision tree algorithm. So, If you are not very much familiar with the decision tree algorithm then I will recommend you to first go through the decision tree algorithm from here.

How to Visualize a Decision Tree?

If you are a practitioner in machine learning or you have applied the decision tree algorithm before in a lot of classification tasks then you must be confused about why I am stressing to visualize a decision tree. Just look at the picture down below.

image for post

In the right side, we have a visualization of the output we get when we use a decision tree algorithm on data to predict the possibilities. In the left side, we have the structure that a decision tree algorithm follows to make predictions by making trees.

So, I hope now you know what’s the difference between visualizing the decision tree algorithm on the data, and to visualize the structure of a decision tree algorithm. Now let’s see how we can visualize a decision tree.

#machine learning #deep learning

Visualize a Decision Tree
1.25 GEEK