0% found this document useful (0 votes)
11 views26 pages

Decision Tree

Decision Trees (DT) are a popular machine learning method used for making decisions based on data by modeling relationships between variables. They consist of a flowchart-like structure with nodes for decisions, branches for outcomes, and leaf nodes for final predictions, applicable to both categorical and continuous data. DT algorithms like ID3 and CART utilize metrics such as Gini impurity and information gain for attribute selection and are widely used in applications like recommendation systems, fraud detection, and financial analysis.

Uploaded by

abhaysharmansut
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
0% found this document useful (0 votes)
11 views26 pages

Decision Tree

Decision Trees (DT) are a popular machine learning method used for making decisions based on data by modeling relationships between variables. They consist of a flowchart-like structure with nodes for decisions, branches for outcomes, and leaf nodes for final predictions, applicable to both categorical and continuous data. DT algorithms like ID3 and CART utilize metrics such as Gini impurity and information gain for attribute selection and are widely used in applications like recommendation systems, fraud detection, and financial analysis.

Uploaded by

abhaysharmansut
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

Supervised Learning-

Decision Trees
Decision Trees(DT)
❑Popularly used in ML, Data Mining and Statistics
❑Provide clarity to make decisions based on data by modelling the relationships
between different variables.
❑A decision tree is a flowchart-like structure used to make decisions or
predictions.
❑It consists of nodes representing decisions or tests on attributes, branches
representing the outcome of these decisions, and leaf nodes representing final
outcomes or predictions.
❑Works for categorical as well as continuous data.
Structure of DT
❑Root Node: Represents the entire dataset and
the initial decision to be made. The feature
attribute in this node is selected based on
Attribute Selection Techniques.
❑Internal Nodes: Represent decisions or tests
on attributes. Each internal node has one or
more branches.
❑Branches: Represent the outcome of a
decision or test, leading to another node.
❑Leaf Nodes: Represent the final decision or
prediction. No further splits occur at these
nodes.
DT follows- IF-ELSE condition
How DT work?
The process of creating a decision tree involves:
❑Selecting the Best Attribute: Using a metric like Gini impurity, entropy, or information gain, the
best attribute to split the data is selected.
❑Splitting the Dataset: The dataset is split into subsets based on the selected attribute.
❑Repeating the Process: The process is repeated recursively for each subset, creating a new
internal node or leaf node until a stopping criterion is met (e.g., all instances in a node belong to
the same class or a predefined depth is reached).
ENTROPY
Entropy
GINI IMPURITY
Information Gain
DT algorithms

❑ID3 - Iterative Dichotomiser 3- uses Information Gain. This is only for classification.

❑CART- Classification and Regression Trees - for classification, it uses Gini Impurity and for
regression tasks- Mean Squared Error(MSE) and Mean Absolute Error(MAE).
ID3 Example - Build a decision tree using ID3 algorithm for the given
training data in the table (Buy Computer data), and predict the class of the following
new example: age<=30, income=medium, student=yes, credit-rating=fair
Maximum Information Gain -> Age, so root node will be AGE
We keep on repeating the step for
subtrees

<=30 >=31 & >40


<=40
Final Decision Tree (MAX 2 levels)
Issues with Decision Trees
Applications
❑Recommendation Systems- Many online platforms use decision trees as part of their
recommendation algorithms. For example, Netflix or Spotify may use decision trees to
determine what movies or songs to recommend based on a user’s past viewing or listening
habits, demographic information, and preferences.
❑Fraud Detection- Decision trees can help detect fraud by identifying patterns in transactions.
❑Customer relationship management (CRM)- Companies use decision trees to predict customer
behavior, such as whether a customer will churn or respond positively to a marketing campaign.
❑Financial Analysis- In the financial sector, decision trees are used in options pricing and
strategy development. They can model possible future price movements based on different
market conditions to help investors make informed decisions.

You might also like