0% found this document useful (0 votes)
13 views27 pages

Decision Tree - Gini Index

Uploaded by

comrade0808
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views27 pages

Decision Tree - Gini Index

Uploaded by

comrade0808
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

NEIL GOGTE INSTITUTE OF TECHNOLOGY

&
KESHAV MEMORIAL ENGINEERING COLLEGE

ARTIFICIAL INTELLIGENCE
(PC 502CSM)

Deepika.M
Assistant Professor, CSE(AIML)
NGIT
UNIT-IV
Learning

DECISION TREES
Gini index
• The Gini index measures impurity or inequality
frequently used in decision tree algorithms.
• It quantifies the probability of misclassifying a
randomly chosen element if it were randomly
labeled according to the distribution of labels in a
particular node.
• The equation for the Gini index is as follows:

where p1​, p2​, ..., pk​are the probabilities of each


class in the node.
• The GiniA​(D) represents the weighted Gini index
for the entire dataset D. It's a measure of
impurity or inequality in the dataset, considering
the weighted average of the impurities of two
subsets, D1​and D2​.
• n1​: This is the number of instances (data points)
in subset D1​.
• n2​: This is the number of instances (data points)
in subset D2​.
• n: The total number of instances in the entire
dataset D(n=n1+n2).
• Gini(D1​): This is the Gini index of subset D1​,
which quantifies the impurity or uncertainty of
class labels in D1. A lower Gini index indicates
higher purity.
• To calculate the Gini index for each attribute and
construct a decision tree, we'll start by analyzing
the given data and calculating the Gini index for
each attribute at the first step. We have four
attributes in the above dataset:
Steps to construct a
decision tree
• By leveraging the Gini index, which
measures the impurity of a node, we were
able to determine the best splitting criteria
for creating an effective decision tree
model.
• This approach allowed us to make
informed decisions based on the purity
and predictive power of each node in the
tree.
• The Gini index offers a valuable tool for
decision tree construction, enabling us to
efficiently handle categorical and
numerical features.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy