Rule-Based Classification
Rule-based classifiers use a set of IF-THEN rules to classify tuples; they are the most human-interpretable model family (used in expert systems, fraud detection, credit scoring and clinical decision support).
1. Rule Form and Terminology
where the consequent is a class label. Conditions are of the form $A , {=,
e, <, >, \le, \ge} , v$ (categorical equality or numeric range).
| Term | Meaning |
|---|---|
| Coverage / support of a rule | Fraction of tuples in that satisfy the rule's antecedent: |
| Accuracy / confidence of a rule | Fraction of covered tuples that have the rule's class: |
| Rule set coverage | Fraction of tuples covered by at least one rule |
| Mutual exclusivity | No tuple is covered by more than one rule (ideal but rare) |
Conflict resolution when rules overlap
- Voting — count rules predicting each class; the majority wins (ties broken arbitrarily or by rule accuracy).
- Rule ordering / decision list — rules are ranked; the class of the highest-priority matching rule is chosen.
- Class-based ordering — rules are grouped by class; the class whose rules come first wins (used in RIPPER and C4.5rules).
2. From a Decision Tree to Rules
Each root-to-leaf path becomes a rule (see decision tree notes); trees → rules gives an equivalent but more flexible representation, because conditions can be pruned independently.
Decision tree path: age=youth -> student=yes -> [buys=yes]
Rule: IF age=youth AND student=yes THEN buys_computer=yes
Rule pruning (C4.5rules): remove a precondition if removing it does not reduce estimated accuracy; then eliminate duplicate/dominated rules (keep the simpler rule with lower error; ties → prefer the more general rule).
3. Sequential Covering Algorithm (the classic rule-learning framework)
SequentialCovering(Target_class, Attributes, Data):
1. RuleSet = {} (empty)
2. repeat
Rule = LearnOneRule(Data, Attributes, Target_class)
remove tuples covered by Rule from Data
RuleSet = RuleSet + Rule
until the termination condition (e.g. accuracy of RuleSet >= threshold,
or no more positive tuples)
3. return RuleSet
LearnOneRule performs a greedy, beam search: start with the empty antecedent IF {} (covers everything, accuracy = class prior) and add conditions one at a time, keeping the best k candidates (beam width ) using a measure such as:
where = positive/negative tuples covered after adding the condition, and = before. FOIL is a pure FOIL-gain learner, RIPPER (FOIL + IREP) adds incremental reduced-error pruning.
Rule growth may also use accuracy: — but accuracy alone is weak when positives are rare, hence FoilGain (which also rewards coverage of positive tuples).
4. RIPPER (Repeated Incremental Pruning to Produce Error Reduction)
- Order the classes by increasing frequency (rare classes first → one-vs-rest).
- Grow a rule by adding conditions that maximise FoilGain until it covers no negative tuple (or hits a length limit).
- Prune using the incremental reduced error pruning (IREP) rule: delete the last condition added, computing
- Repeat to obtain a rule set covering the class; then optimise each rule — for every rule, grow two alternatives (replacing the rule, or revising by adding more conditions), prune, and keep the one with the lowest error.
- Stop when the description length of the rule set exceeds a bound.
Advantage: scales to large noisy datasets; produces compact, ordered rule sets.
5. Associative Classification (RIPPER's cousin)
Mine class association rules (CARs) with Apriori/FP-growth, then use the subset of frequent rules with the highest confidence as a classifier (detailed under Associative Classification).
6. Rule Quality Measures
| Measure | Formula | Note |
|---|---|---|
| Support / coverage | or | Frequency |
| Confidence / accuracy | Reliability | |
| Laplace accuracy | ( = #classes) | Corrected for small counts |
| Foil gain | as above | Favours coverage |
| -estimate | ( = prior of ) | Smoothed |
| Lift | Interest |
Example rule: IF income=high AND student=yes THEN buys_computer=yes
- Coverage = 2/14 = 14.3%, accuracy = 2/2 = 100%, Laplace = (2+1)/(2+2) = 75%.
7. Advantages and Limitations
Advantages
- Rule sets are easy to interpret, verify and modify by domain experts; a single rule can be read as an independent piece of knowledge.
- Can express disjunctions of conjunctions; order-independent (unlike a tree's fixed splits).
- Handles missing values (a condition on a missing attribute simply fails) and mixed attribute types.
- Easy to weight/prioritise rules and integrate domain knowledge and cost information; can use only a subset of rules (partial matching) for explanation.
Limitations
- Greedy separate-and-conquer → overlapping, redundant or conflicting rules; may cause overfitting if not pruned.
- Efficiency: rule induction can be slow (many candidate rules); prone to class imbalance (rare classes are learned first or ignored).
- Rule conflicts must be resolved (unordered rule sets need voting/priority rules).
- Performance is usually slightly lower than ensembles/SVM, and strongly dependent on the pruning and stopping criteria.
8. Exam Points
- Explain the sequential covering algorithm with pseudo-code and a worked rule — 10 marks (frequent).
- Define coverage, accuracy and FoilGain; compute them for a given rule — 5-7 marks.
- Explain RIPPER's grow-and-prune cycle (with IRED's ) — 5-7 marks.
- Compare rule-based classification with decision tree induction — 5 marks.