How Decision Tree works?

Decision Tree is a well-known member of the family of supervised learning algorithms. It is used for solving both regression and classification problems also, but it is preferred more for solving classification problems. It is used for both linear and non-linear data. The decision tree uses the CART algorithm which stands for Classification and Regression Trees. 

The aim of using a decision tree is to create a training model which can be used for predicting the class or values of the target variable just by learning a simple decision rules inferred from prior data or training data.

As the name suggest it is a tree-like structure.It is similar to tree it also starts with root node and expands further into  branches. There are two nodes.

Decision Nodes are used for making decision and has multiple branches while Leaf Nodes have the output of these decision. Leaf Node do not have any other further branches. 

It simply asks a question and gets further split into subtree based on answer yes or no. It bascially a graphical representation for getting all the possible solutions to a problem/decision based on given conditions.

For each step in the decision tree is used for classification. We give a condition on the features to separate all the labels or classes contained in the dataset to the fullest purity.

In Decision Tree  the decision of making strategic splits also affect's the tree accuracy. The decision tree has different decision criteria for classification and regression trees.

It uses multiple algorithms for deciding to split the node into two or more nodes. Here the purity of node increases with the target variables. Firstly Decision Tree splits the nodes for all the variables and then select the split which gives the most homogeneous sub-nodes.The algorithm which will be used are totally based on the type of target variables:

Here are some algorithms used in Decision Trees:

  • ID3 
  • C4.5 
  • CART 
  • CHAID 
  • MARS