0% found this document useful (0 votes)
74 views3 pages

Decision Tree Classification Overview

Uploaded by

ANANTHI K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • Homogeneous Sets,
  • Distance from Office,
  • Classification,
  • Decision Node,
  • Classification Problems,
  • Data Segregation,
  • Leaf Node,
  • Algorithm Explanation,
  • Node Comparison,
  • Child Node
0% found this document useful (0 votes)
74 views3 pages

Decision Tree Classification Overview

Uploaded by

ANANTHI K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • Homogeneous Sets,
  • Distance from Office,
  • Classification,
  • Decision Node,
  • Classification Problems,
  • Data Segregation,
  • Leaf Node,
  • Algorithm Explanation,
  • Node Comparison,
  • Child Node

ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

3.6 DECISION TREE CLASSIFICATION ALGORITHM

o Decision Tree is a Supervised learning technique that can be used for both classification
and Regression problems, but mostly it is preferred for solving Classification problems. It
is a tree-structured classifier, where internal nodes represent the features of a dataset,
branches represent the decision rules and each leaf node represents the outcome.
o In a Decision tree, there are two nodes, which are the Decision Node and Leaf
Node. Decision nodes are used to make any decision and have multiple branches, whereas
Leaf nodes are the output of those decisions and do not contain any further branches.
o The decisions or the test are performed on the basis of features of the given dataset.
o It is a graphical representation for getting all the possible solutions to a problem/decision
based on given conditions.
o It is called a decision tree because, similar to a tree, it starts with the root node, which
expands on further branches and constructs a tree-like structure.
o A decision tree simply asks a question, and based on the answer (Yes/No), it further split
the tree into subtrees.
o Below diagram explains the general structure of a decision tree:

CS3491-ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING


ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

Decision Tree Terminologies

Root Node: Root node is from where the decision tree starts. It represents the entire dataset,
which further gets divided into two or more homogeneous sets.

Leaf Node: Leaf nodes are the final output node, and the tree cannot be segregated further after
getting a leaf node.

Splitting: Splitting is the process of dividing the decision node/root node into sub-nodes
according to the given conditions.

Branch/Sub Tree: A tree formed by splitting the tree.

Pruning: Pruning is the process of removing the unwanted branches from the tree.

Parent/Child node: The root node of the tree is called the parent node, and other nodes are
called the child nodes.

How does the Decision Tree Algorithm Work?

In a decision tree, for predicting the class of the given dataset, the algorithm starts from the
root node of the tree. This algorithm compares the values of root attribute with the record (real
dataset) attribute and, based on the comparison, follows the branch and jumps to the next node.
For the next node, the algorithm again compares the attribute value with the other sub-nodes and
move further. It continues the process until it reaches the leaf node of the tree. The complete
process can be better understood using the below algorithm:

Step-1: Begin the tree with the root node, says S, which contains the complete dataset.

o Step-2: Find the best attribute in the dataset using Attribute Selection Measure (ASM).
o Step-3: Divide the S into subsets that contains possible values for the best attributes.
o Step-4: Generate the decision tree node, which contains the best attribute.
o Step-5: Recursively make new decision trees using the subsets of the dataset created in
step -3. Continue this process until a stage is reached where you cannot further classify the
nodes and called the final node as a leaf node.

CS3491-ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING


ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

Example: Suppose there is a candidate who has a job offer and wants to decide whether he should
accept the offer or Not. So, to solve this problem, the decision tree starts with the root node (Salary
attribute by ASM). The root node splits further into the next decision node (distance from the
office) and one leaf node based on the corresponding labels. The next decision node further gets
split into one decision node (Cab facility) and one leaf node. Finally, the decision node splits into
two leaf nodes (Accepted offers and Declined offer). Consider the below diagram:

Attribute Selection Measures

While implementing a Decision tree, the main issue arises that how to select the best attribute
for the root node and for sub-nodes. So, to solve such problems there is a technique which is called
as Attribute selection measure or ASM. By this measurement, we can easily select the best
attribute for the nodes of the tree. There are two popular techniques for ASM, which are:

o Information Gain
o Gini Index

CS3491-ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING

Common questions

Powered by AI

Splitting in a decision tree involves dividing the dataset at each node into more homogeneous subsets based on attribute selection. Optimal splits are ensured by selecting the attribute that offers the highest Information Gain or lowest Gini Index, achieving maximal purity changes between nodes and their subsequent branches. The process includes evaluating all potential splits and selecting the one leading to the most significant reduction in impurity or entropy. Steps such as calculating metrics like Information Gain or Gini Index for available attributes allow the tree to make informed splits that enhance classification accuracy .

Decision trees are preferred over other classification algorithms due to their intuitive and transparent nature, facilitating ease of interpretation and understanding by end-users. They naturally handle both numerical and categorical data, providing flexibility in varied applications. Their graphical visualization appeals to stakeholders who need to comprehend the decision process quickly. Though trees can overfit, techniques such as pruning, ensemble methods like Random Forests, and tuning can mitigate this downside, making them an adaptive choice in balancing accuracy with interpretability compared to black-box models like neural networks .

Decision trees leverage graphical representation to aid decision-making by visually depicting all possible solutions and paths based on set conditions. Each tree begins with a root node containing the entire dataset, which is split into branches at decision nodes, representing feature-based questions. The visual format allows users to understand the step-by-step progression of decisions leading to a final outcome at the leaf nodes. This transparency and clarity make decision trees particularly useful for decision-makers as they easily visualize and interpret the consequences of various decisions and their pathways .

The root node is the starting point of a decision tree that contains the complete dataset. Its role is to initiate the data splitting process by using the most informative attribute as determined by the Attribute Selection Measure (ASM). This selection is crucial since the root node sets the basis for further splits, thereby influencing the overall structure and accuracy of the tree. The best attribute for the root node is typically the one that provides the highest Information Gain or the lowest Gini Index, leading to the most homogeneous splits .

Attribute Selection Measures (ASM) determine how the decision tree splits nodes by identifying the most informative attributes. This step is crucial as it impacts the tree's effectiveness and accuracy. Common techniques for ASM include Information Gain and the Gini Index. Information Gain evaluates which attribute divides the dataset into the best-defined classes by maximizing the reduction in entropy. The Gini Index measures the impurity of a dataset and selects attributes that result in the lowest impurity after the split, thereby ensuring that data subsets are as homogeneous as possible .

Pruning in decision trees involves the removal of sections of the tree that provide little power in classifying instances. This process reduces overfitting by simplifying the decision tree, leading to a model that generalizes better to unseen data. By eliminating branches that contain noise or adapt too closely to the training set, pruning enhances the tree's predictive accuracy and efficiency. It can be achieved through methods such as cost-complexity pruning, where nodes are evaluated for their contribution to the tree's accuracy and are removed if their removal does not significantly decrease predictive performance .

Branches and sub-trees in a decision tree dictate the pathway that data traversal follows to reach a classification or regression outcome. Each branch represents a decision rule that results in further sub-tree development. As branches and sub-trees proliferate, the tree becomes more complex, capturing detailed nuanced patterns within the data. However, this can lead to overfitting, where the model is highly accurate on training data but lacks generalizability. Conversely, appropriate pruning helps maintain tree simplicity and effectiveness, allowing it to remain a robust predictive model by focusing on significant patterns without excess complexity .

Decision trees handle classification problems by dividing data into classes based on feature decisions captured at each node until reaching a classification outcome in the leaf nodes. For regression, they predict continuous values by segmenting the data range and assigning an average or most likely outcome to each leaf node. While capable of both functions, decision trees are more commonly used for classification because their structure naturally fits scenarios where data can be split into distinct classes, and their intuitive graphical representation facilitates the understanding of categorical decision-making .

A decision tree is primarily composed of root nodes, decision nodes, branches, and leaf nodes. The root node represents the entire dataset, which is split using decision nodes and branches based on the dataset features. Each decision node poses a question regarding a feature, and the branches represent possible answers. The tree's progression through these nodes and branches continues until it reaches a leaf node, which represents the classification outcome. These elements interact by forming a tree-like structure that guides the data classification process through a series of logical decisions .

Pruning is especially beneficial in scenarios where overfitting is a concern. Overfitting occurs when a decision tree becomes too complex, capturing noise and patterns specific only to the training data. This often results in poor generalization to new data. Pruning removes unnecessary branches, simplifying the model and improving its performance on unseen datasets. It is valuable in situations with limited data, noisy data, or when the tree has high variance, as it leads to more robust, simpler models with better predictive power on different data samples .

You might also like