Entropy and Information Gain Explained
Entropy and Information Gain Explained
htm
Entropy
A decision tree is built top-down from a root node and involves partitioning the data into subsets that
contain instances with similar values (homogenous). ID3 algorithm uses entropy to calculate the
homogeneity of a sample. If the sample is completely homogeneous the entropy is zero and if the
sample is an equally divided it has entropy of one.
To build a decision tree, we need to calculate two types of entropy using frequency tables
as follows:
.
`
Information Gain is the expected reduction in entropy caused by partitioning the examples according to a
particular attribute – when the number of instances of each value is equal (eg circles or crosses in the above
example), then information reaches its maximum because we are very uncertain about the outcome.
Step 3: Choose attribute with the largest information gain as the decision node, divide the dataset by its
branches and repeat the same process on every branch.
Step 5: The ID3 algorithm is run recursively on the non-leaf branches, until all data is classified.
Decision Tree to Decision Rules
A decision tree can easily be transformed to a set of rules by mapping from the root node to the leaf nodes
one by one.