- Year not given · 10 marks
- 2066 Bhadra · 3 marks
Rules generation using ID3
Short answer
ID3 builds a decision tree on maximum information gain, then converts each root-to-leaf path into an IF-THEN rule: the tests along the path form the antecedent (AND) and the leaf class the consequent. For example, IF Outlook=Sunny AND Humidity=High THEN Play=No.
How do you generate rules with ID3? Explain with example. (Also asked as: write a short note on rules generation using the ID3 technique.)
A decision tree built by ID3 can be converted into IF-THEN classification rules. Each path from the root to a leaf gives one rule: the attribute tests along the path are joined by AND to form the condition (antecedent), and the leaf class is the consequent. The rules are mutually exclusive and exhaustive, and are easier for humans to read than a large tree.
Procedure
- Build the tree using ID3: at each node pick the attribute with maximum information gain.
- Traverse each root-to-leaf path.
- Write
IF (test1) AND (test2) ... THEN class = leaf. - Optionally simplify: drop a condition if accuracy does not fall (pruning of rules), and remove duplicate rules.
Example (Play Golf data, 14 records, 9 Yes, 5 No)
Entropy of the data = 0.940. Gains: Outlook 0.247, Humidity 0.152, Windy 0.048, Temperature 0.029. So Outlook is the root.
Outlook
|-- Overcast --> Yes
|-- Sunny --> Humidity
| |-- High --> No
| |-- Normal --> Yes
|-- Rainy --> Windy
|-- False --> Yes
|-- True --> No
Rules generated
- IF Outlook = Overcast THEN Play = Yes
- IF Outlook = Sunny AND Humidity = High THEN Play = No
- IF Outlook = Sunny AND Humidity = Normal THEN Play = Yes
- IF Outlook = Rainy AND Windy = False THEN Play = Yes
- IF Outlook = Rainy AND Windy = True THEN Play = No
Number of rules = number of leaves (5 here). A new tuple is classified by the first rule whose condition it satisfies.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Overfitting in ID3 and decision tree rules · Data Mining, chapter 3
- ID3 steps, overfitting, TP/FP/recall · Data Mining, chapter 3
- Indicator organism; membrane filter technique · Water Supply Engineering, chapter 4 · asked 2×
- Zones of protection and their rules · Switchgear and Protection, chapter 1 · asked 2×
- Rules of inference: movie and sunset · Discrete Structure, chapter 1
- Rules of inference: sailing race · Discrete Structure, chapter 1