---
title: "Rule based classifier; coverage and accuracy"
subject: "Data Mining"
chapter: 3
key: "semester_7/data_mining:rule-based-classifier-measures"
source: https://www.bctengineer.com/q/semester_7/data_mining/rule-based-classifier-measures
site: BCT Engineering
---

# Rule based classifier; coverage and accuracy

Data Mining · Chapter 3: Classification

- Asked in: year not given
- Video: [Machine Learning | Rule-based Classifier](https://www.youtube.com/watch?v=fmZaVTpRO-Q) — RANJI RAJ
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/rule-based-classifier-measures
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-3

## Question

Define rule based classifier with example. Describe rule assessment measures - Coverage and Accuracy.

## Short answer

A rule-based classifier uses IF-THEN rules, e.g., IF age=youth AND student=yes THEN buys_computer=yes. Coverage is the fraction of all training records the rule covers (n_covers/|D|); accuracy is the fraction of those covered that are correctly classified (n_correct/n_covers). For the example, coverage is 2/14=14.3% and accuracy is 2/2=100%.

## Answer

A **rule-based classifier** classifies records using a collection of **IF-THEN rules**. A rule has the form

R: IF (condition) THEN (class)

where the condition (antecedent or precondition) is a conjunction of attribute tests and the consequent is the predicted class. *Example*: R1: IF age = youth AND student = yes THEN buys_computer = yes.

A rule **covers** a record if the record satisfies its condition; it **fires** when it is used to classify the record. Rules may be extracted from a decision tree or learnt directly (sequential covering).

#### Rule assessment measures
Let D be the training data, n_covers the number of records covered by rule R, and n_correct the number of those covered records that R classifies correctly.

- **Coverage** = n_covers / |D|. It is the fraction of all records the rule applies to.
- **Accuracy** = n_correct / n_covers. It is the fraction of covered records classified correctly.

*Example* (buys-computer data, |D| = 14): R1 covers records 9 and 11 (young, student = yes); both are "yes".
- Coverage(R1) = 2/14 = 14.3%
- Accuracy(R1) = 2/2 = 100%

A good rule has both high coverage and high accuracy. If several rules fire for a record, conflict resolution uses size ordering (the rule with most attribute tests), class-based ordering or rule ordering (decision list); if none fires, a default rule is used.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. A rule has the form:
   A. IF (class) THEN (condition)
   B. FOR (class) DO (tree)
   C. IF (condition) THEN (class)
   D. WHEN (distance) USE (cluster)
   Answer: C. Antecedent is a conjunction of attribute tests. (Key point: Rule form)

2. Coverage of a rule is:
   A. n_correct / n_covers
   B. n_correct / |D|
   C. n_covers / n_correct
   D. n_covers / |D|
   Answer: D. Fraction of all records the rule applies to. (Key point: Coverage)

3. Accuracy of a rule is:
   A. n_correct / n_covers
   B. n_covers / |D|
   C. n_correct / |D|
   D. 1 - coverage
   Answer: A. Fraction of covered records classified correctly. (Key point: Accuracy)

4. R1 covers 2 of 14 records, both correct. Coverage and accuracy are:
   A. 100% and 14.3%
   B. 14.3% and 100%
   C. 14.3% and 14.3%
   D. 50% and 100%
   Answer: B. 2/14 and 2/2. (Key point: Example)

## Related in Data Mining

- [Rule based classifier pros and cons](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Arule-based-pros-cons) — Data Mining, chapter 3
- [Sequential covering for rule induction](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Asequential-covering) — Data Mining, chapter 3

## Related in other subjects

- [Rule based reasoning; backward chaining](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Arule-based-reasoning-backward-chaining) — Artificial Intelligence, chapter 4
