Master the RIPPER algorithm for global rule set optimization. Learn how to overcome sequential covering's greedy limitations through rule re-specialization and re-generalization.
Sequential covering is a greedy algorithm that learns rules one at a time, never revisiting or modifying previously learned rules. This can lead to suboptimal rule sets because early rules may prevent better rules from being discovered later.
RIPPER (Repeated Incremental Pruning to Produce Error Reduction) addresses this by optimizing rules globally. After generating an initial rule set, RIPPER iteratively refines each rule by re-learning it on its covered samples, potentially finding better rules that improve the entire rule set's performance.
Key Innovation:
Instead of treating rules as immutable, RIPPER allows rules to be re-specialized and re-generalized based on their contribution to the overall rule set performance, not just individual rule quality.
Use IREP* algorithm to generate an initial rule set that covers most training samples. This provides a starting point for optimization.
Example:
Initial rule set: 3 rules covering 95% of training samples with 82% overall accuracy.
For each rule in the rule set:
Repeat step 2 for all rules in the rule set. Continue iterating until:
RIPPER uses two complementary strategies to optimize rules:
Start from current rule and add literals to reduce negative coverage while maintaining positive coverage:
Example:
Current rule:
Covers: 50 positives, 20 negatives (accuracy: 71%)
Re-specialize:
Covers: 45 positives, 5 negatives (accuracy: 90%) ✓ Better!
Start from current rule and remove literals to increase coverage while maintaining acceptable accuracy:
Example:
Current rule:
Covers: 30 positives, 2 negatives (accuracy: 94%, but low coverage)
Re-generalize:
Covers: 45 positives, 5 negatives (accuracy: 90%, better coverage) ✓ Better overall!
The key difference between RIPPER and sequential covering is global evaluation. Instead of evaluating a rule in isolation, RIPPER evaluates how the rule contributes to the entire rule set's performance.
Why Global Evaluation Matters:
A rule that improves individually may not improve the rule set if it overlaps with other rules. Global evaluation ensures that rule changes benefit the entire system, not just the individual rule.
Apply RIPPER to fraud detection. Optimize an initial rule set through iterative re-specialization and re-generalization.
| Iteration | Rule | Validation Accuracy | Action |
|---|---|---|---|
| 1 | fraud ← (amount > $10,000) ∧ (location = foreign) | 85% | Initial rule |
| 2 | fraud ← (amount > $10,000) ∧ (location = foreign) ∧ (time = night) | 88% | Re-specialize |
| 3 | fraud ← (amount > $10,000) ∧ (location = foreign) | 90% | Re-generalize |
| 4 | fraud ← (amount > $10,000) ∧ (location = foreign) | 90% | Converged |
RIPPER improves rule from 85% to 90% validation accuracy through re-specialization and re-generalization.
Original rule covers some legitimate transactions. Add "time = night" literal to reduce false positives.
Result: Accuracy improves from 85% to 88%, but coverage decreases slightly.
"time = night" literal is too restrictive. Remove it to increase coverage while maintaining good accuracy.
Result: Accuracy improves to 90% with better coverage. Global evaluation shows this is better for the rule set.
RIPPER successfully optimizes the rule through iterative refinement. The final rule achieves 90% validation accuracy, better than the initial 85%, demonstrating the power of global optimization over greedy sequential covering.