Lazy Learner & Rule Based Classification�
Unit-3
Introduction
Example: KNN Classification Algorithm
Rule Based Classification
IF-THEN rules are defined as
IF condition THEN conclusion
Let us consider a rule R1,�R1: IF age = youth THEN buy_computer = yes
Points to remember −
IF condition1 AND condition2 THEN conclusion
Rule Extraction
Building Classification Rules:
Step 1: Rule Growing
Start from an empty rule. Grow a rule using the 1R algorithm such that the rule covers the majority of records of the class.
Step 2: Instance Elimination
Remove the records covered by the previous rule. This step ensures that the following rule will differ from the previous one. It improves the accuracy of the rule as well.
Step 3: Rule Evaluation
Evaluate each rule’s accuracy. Repeat the above two steps until a stopping criterion is met.
Step 4: Stopping Criteria
If the accuracy of the rule is not up to mark, then discard that rule.
Step 5: Rule Pruning
Calculate the error rate at every step similar to the 1R algorithm. Suppose the error rate increases; prune that rule and again compare the error rate before and after pruning and take the best decision. If rule pruning is unnecessary, add that rule to the existing ruleset.