---
title: "The CN2 Induction Algorithm — paper by Clark and Niblett (1989)"
description: "CN2 learns ordered if-then rules from examples, using statistical evidence to limit overfitting in medical and synthetic classification tasks."
canonical: "https://research.elamur.ai/free/en/papers/clark-1989-cn2-induction-algorithm/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/clark-1989-cn2-induction-algorithm/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [1989](https://md.research.elamur.ai/free/en/papers/1989/) / The CN2 Induction Algorithm

# The CN2 Induction Algorithm

Paper · 1989 · Peter A. Clark and Tim Niblett

**Authors:** Peter A. Clark and Tim Niblett · **Year:** 1989 · **Venue:** Machine Learning · **Licence:** No open licence stated (free-to-read copy; rights reserved) — text kept private

[Cited by **31** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/clark-1989-cn2-induction-algorithm/cited-by/) · Machine Learning

- [PDF](https://link.springer.com/content/pdf/10.1007/BF00116835.pdf)
- [DOI 10.1007/bf00116835](https://doi.org/10.1007/bf00116835)

## Summary

A rule learned from examples can predict every case it has seen and still give poor answers on new cases. A few wrong measurements, uncertain labels or missing distinctions between cases can lead a learning algorithm to add conditions that explain quirks of the training data. Clark and Niblett designed CN2 to learn short if-then rules even when some examples resist a clean explanation. The intended use was knowledge acquisition for expert systems, where a specialist needs to examine what a program has learned as well as assess its predictions. This gives the paper two concerns, predictive accuracy and [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/).

CN2 builds an ordered list. It searches for a combination of attribute tests that selects a group of examples with a strong tendency toward one class. It ranks candidate conditions by the concentration of their class distributions and checks whether those distributions differ sufficiently from what random selection would produce. An accepted condition becomes a rule predicting the most frequent class among the examples it selects. CN2 removes those examples from the next search and continues with the remaining cases. At prediction time, the first applicable rule supplies the answer. A final fallback predicts the class most frequent in the training data.

The paper compares CN2 with a decision-tree learner, a reconstruction of basic AQ rule induction, a Bayesian classifier and a most-frequent-class baseline. In the lymphography task, CN2 at the 99% significance threshold achieved 82% average test accuracy with a reported complexity of 12 selectors. The Bayesian classifier reached 83%, the highest reported accuracy for that task. In the breast cancer recurrence task, the most-frequent-class baseline reached 71%, matching CN2 at its strictest setting. The primary tumor task yielded lower accuracy across the systems. There, several distinct diagnoses could share the same recorded attributes, limiting what a rule could recover from those attributes.

The artificial tasks let the authors vary corruption in the training data while keeping the test data clean. ASSISTANT, the decision-tree learner, generally predicted more accurately in these tasks. CN2 often produced smaller descriptions by the paper’s structural measures, and its learned rules were usually more accurate on the cases they handled than the complete list was across all test cases. The most revealing test was full randomization. CN2 fell back to the default alone in one artificial domain and still found apparently significant conditions in the other. The statistical filter helped control how much structure CN2 learned, while the result under full randomization showed how a broad search can find misleading regularities even with a stringent threshold.

## Deep dive: The CN2 Induction Algorithm

CN2 learns ordered if-then rules from examples, using statistical evidence to limit overfitting in medical and synthetic classification tasks. · about 36 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### When a correct training answer is a poor guide

The paper starts from a practical difficulty in building expert systems. A program needs a procedure for deciding which class to assign to a case, and obtaining such a procedure from a domain specialist can be difficult. A collection of examples offers another route. Each case supplies a set of recorded attributes and a class, and the learning program looks for relationships that can be used to classify future cases. In a medical dataset, the records might contain findings, while the class identifies an outcome or diagnostic category. The authors treat induction from these records as a way to help obtain usable decision procedures.

The usefulness of an induced description depends on what happens after training. A specialist needs an accurate procedure and may also want to see why a particular decision follows. A compact condition in an if-then rule presents a small set of statements that the specialist can inspect. As the learner adds more special cases, the resulting procedure can become harder to validate. The authors therefore judge a description partly by how much structure the learner needs to obtain its accuracy.

Perfect agreement with the training cases creates a particular tension. A learner may discover a broad relationship and then encounter examples that contradict it. Adding tests can isolate those examples or split them away from a rule. If the exceptions reflect recording errors or distinctions the input cannot express, the learner has spent its descriptive capacity on details with little value for future cases. The resulting reduction in training error can coexist with a decline in predictive accuracy. The paper uses overfitting to describe this kind of excessive adjustment to the particulars of the training sample.

Noise and inadequate description can cause related problems. A recorded value can be wrong, making a case appear similar to examples from a different class. A perfectly recorded case can also lack the attribute needed to explain its class. When examples from different classes have identical values on every available attribute, any procedure using those attributes alone must treat them alike. A learner that tolerates such ambiguity can preserve a useful rule for the cases it generally describes. It must still decide how much inconsistency to accept and when additional conditions are worth keeping.

Cost matters as well. If the method is meant to help someone explore a substantial data collection, an exhaustive inspection of possible descriptions can make otherwise appealing rules impractical to obtain. The authors want the basic operations to scale well with the number of examples. They distinguish this goal from minimizing the size of the final description by trying every possible arrangement. The space of candidate descriptions is already too large for that strategy in the systems they consider.

#### What the tree and rule traditions offered

The authors trace CN2 to ID3 and AQ. In the ID3 family, a decision tree starts with all the available training cases at its root. Testing an attribute creates branches for its possible outcomes. Each branch takes responsibility for the examples that produce its outcome, and this process recurs on the resulting groups. A terminal node, or leaf, stores a class. A new case follows the path specified by its attribute values until it reaches a leaf that supplies the prediction.

Growing a tree makes successive predictions more specific. Replacing a leaf with a test lets the tree distinguish cases it previously treated alike. That structure offers a convenient point at which to stop, since the current leaf already supplies a prediction if another split seems unwarranted. The comparison system ASSISTANT uses an entropy-based heuristic to choose the next attribute test and a cutoff procedure that estimates whether further branching would reduce classification accuracy. Its unpruned version uses a purity condition expressed in terms of the labels at the node. The paper also describes pruning in other descendants of ID3 as an established response to overfitting.

AQ approaches the same task through rules. Its basic search centers on a positive example, meaning a case of the class the system is currently trying to describe. The case acts as a seed. Conditions are added to preserve coverage of that seed while excluding selected negative examples, meaning cases of other classes. Keeping several plausible conditions gives the search room to consider different ways of separating those examples. After selecting a condition, the procedure can repeat with another uncovered positive case. Together, the conditions form alternative ways for a case to satisfy the rule for that class.

The paper explains why this use of particular examples makes the original AQ search harder to adapt to noise. The seed guides which conditions can be entertained, and the insistence on getting rid of negative examples makes near-perfect training consistency a goal of rule construction. If an excluded case looks like an exception only because of a recording error, requiring a condition to separate it still sends the search in a particular direction. Existing AQ systems addressed noise with steps surrounding rule generation. The authors wanted to make tolerance for imperfect rules part of generation itself.

CN2 retains the idea of exploring several rule conditions at once. Its search starts with a condition that accepts everything and considers ways of narrowing it through attribute tests. At each round, the available tests determine the possible refinements. A particular seed or counterexample has no privileged role in deciding which of those refinements are legal. Because conditions can be judged while they still cover examples of several classes, CN2 can accept a useful rule before the covered group becomes pure. This is the connection the authors draw between a cutoff in tree growth and a cutoff in rule construction.

The output also changes the way rules interact. AQR, the paper’s reconstruction of basic AQ, can find several applicable class rules for a case, so it needs a procedure to resolve the conflict. CN2 makes priority explicit in the list. A reader can follow the same procedure as the classifier by reading from the top and stopping at the first match. Understanding the scope of a rule lower down requires knowing what the earlier rules already handle. The authors present both consequences as relevant when assessing how comprehensible the learned descriptions are.

### The method, step by step

#### From an attribute test to a decision list

CN2 receives examples in a common format. Each has named attributes, values for those attributes and a class supplied in the data. A selector is a test of one attribute. A selector can ask whether a recorded category equals a given value, whether the value falls among several alternatives, or whether a quantity is on a specified side of a boundary. The term “complex” denotes a conjunction of selectors. Every selector in a complex must hold for a case to satisfy it. The paper calls that relationship coverage. A complex covers exactly the examples for which its whole condition is true.

The empty complex has no requirements, so it covers every case. Adding another requirement generally makes the condition more selective. Specialization can also narrow a selector that allows alternative values by dropping an alternative. Some operations yield nothing useful. Repeating a test already required by a complex leaves its meaning unchanged. Combining mutually incompatible requirements on the same attribute gives a condition no case can satisfy. The search discards such results.

A complex becomes a classification rule when it is associated with a predicted class. Imagine following the rules for a patient record. The first conditional rule asks whether the record meets all its tests. A match ends the evaluation with that rule’s prediction. If the condition fails, the classifier checks the next rule. A record reaching the bottom receives the default prediction. The default uses the most frequent class in the original training data.

This procedure explains what a learned condition means in context. A rule can be written using only the tests that form its complex, but the cases it actually classifies have also failed every earlier rule. The list supplies those restrictions through order. When the paper talks about the examples covered by a later rule during training, the relevant pool has already been reduced by earlier rules. Later rules can therefore describe patterns found among the cases still awaiting a prediction.

How CN2 learns an ordered decision list The steps in order.

#### Searching for the next condition

The learning procedure has an outer loop for building the list and an inner search for the next complex. At the start of the outer loop, every training example is available. The inner search receives the current pool, which may be the full set or the remainder after several rules. It starts afresh from the empty condition. Once the inner search returns a complex, CN2 finds the examples it covers in that pool and assigns their most frequent class as the rule’s prediction.

Every example covered by the accepted condition is removed, including examples whose true class differs from the rule’s prediction. This makes the outer loop agree with the order used at prediction time. A rule predicts its chosen class whenever it is the first match. A later rule would have no opportunity to correct that decision for an example already claimed. Removing the minority-class cases together with the majority cases reflects that behavior in the training procedure.

After removal, CN2 appends the next rule only if it can find another satisfactory condition. If the inner search returns no acceptable candidate, the rule list is finished even if unassigned examples remain. Exhausting the available examples also ends rule construction. The default then covers whatever a new case fails to match, including cases with combinations of values that never occurred in training. In the absence of accepted conditions, it is the entire decision procedure.

The inner search uses a beam, a fixed-size collection of conditions to pursue at a given stage. The paper calls this collection the star. At the outset, the star contains the empty complex. The implementation forms the next set of candidates by conjoining each current complex with the available selectors. It removes unchanged and incompatible conditions, evaluates the remaining candidates on the current example pool, and trims the set to the permitted size. The survivors become the star for the next round.

There are two records to keep distinct. The star holds the promising candidates whose specializations can still be explored. A separate record holds the best acceptable complex encountered during the search. A complex can be accepted into that record if it passes the significance test and improves on the incumbent by the quality criterion. The beam itself is trimmed by the quality criterion. As a result, a promising condition can have descendants explored even when it fails the significance test for becoming a rule. The pseudocode ends the inner search when there are no remaining specializations in the star and returns the best acceptable complex it found along the way.

This distinction clarifies the role of the statistical cutoff. It can stop a more specialized condition from replacing an already acceptable one. It can also prevent the outer loop from adding another rule at all. The selection step gives the search permission to use a condition with impure coverage, while the significance test sets a minimum level of support for using it. In the pseudocode, the first failed significance test does not send the whole search directly to the default.

The maximum star size determines how many ranked candidates can lead to further refinements at each stage. A broad star can preserve an alternative that is less attractive early and yields a useful condition after another test is added. A narrow star spends less work on competing paths. The paper notes that when the beam keeps a single complex, the refinement has the character of growing a single branch in ID3. The full CN2 procedure still builds its list by starting a new search on the cases left after each accepted rule.

The implementation handles numeric and missing values before or during this process in straightforward ways. The user supplies the range and the sizes of subranges for a continuous attribute. Tests can then refer to the boundaries between those subranges. A missing categorical value is replaced with the most common value of its attribute in the training data. For a numeric attribute, the replacement is the midpoint of the most common subrange. The learner can then evaluate such examples using the same selectors as for complete cases. The choice of available subdivisions affects which numeric distinctions it can express.

#### Ranking candidates by class concentration

For each candidate, CN2 counts the training cases it covers in each class. It then treats those counts as a distribution over the classes. The proportion of covered examples in each class determines the entropy of the candidate. A group dominated by one class has low entropy. A group whose labels are spread more evenly has higher entropy. The score serves both to rank contenders for the best rule and to decide which candidates survive when the star becomes too large.

```
H = −∑ᵢ Pᵢ log₂(Pᵢ)
```

Here H is the entropy of the labels among the covered examples. The index i identifies a class, and the sum ∑ᵢ runs over the classes. Pᵢ is the fraction of the covered examples whose label is class i. The notation log₂ means the logarithm to base 2. A class with zero covered examples contributes nothing. The leading minus sign makes the entropy larger when the probability mass is spread across classes. CN2 favors smaller H.

A simpler ranking would consider only the fraction belonging to the most frequent covered class. The authors illustrate the difference with the distributions (0.7, 0.1, 0.1, 0.1) and (0.7, 0.3, 0, 0), in which the entries are the proportions of covered examples in each class. Both have a majority-class proportion of 0.7. Entropy favors the latter distribution, because all the remaining probability lies in one other class. If a later refinement excludes the current majority examples, that concentration can leave a pure group. The example explains why the authors cared about the shape of the whole distribution when ranking a condition whose descendants might still be explored.

Entropy reflects the composition of coverage. It can assign the same score to a small group and a large group with identical proportions. An apparently pure collection of very few cases can therefore score well without supplying much evidence for a rule. The algorithm asks a separate statistical question before it will use such a candidate. The authors also report that their experience with the search gave them a practical reason to use entropy. Low-entropy candidates tended to have higher significance, so a ranking chosen for class concentration also helped direct the search toward potentially acceptable conditions.

#### Testing coverage against random selection

The significance check compares the observed counts under a condition with the counts expected from a random selection of the same size. The expected distribution uses the class frequencies in the example pool against which the complex is tested. For the first rule, that pool is the full training set. When earlier rules have removed examples, the comparison for a new condition is with the cases available for that search. Thus a candidate that largely selects a common class has to be judged in light of how common that class already is.

```
N = ∑ᵢ fᵢ
```

Here N is the number of examples the candidate covers, fᵢ is the observed count of those examples with class i, and ∑ᵢ sums the counts over all classes. The expected count eᵢ for class i is that same total N allocated according to the overall proportion of class i in the pool. The observed and expected counts therefore describe equally large groups.

```
G = 2 ∑ᵢ fᵢ ln(fᵢ/eᵢ)
```

G denotes the likelihood-ratio statistic. The sum ∑ᵢ goes over the classes indexed by i. The observed count in class i is fᵢ, and eᵢ is its expected count for random coverage. The slash denotes division, ln is the natural logarithm, and the factor 2 puts the statistic on the scale used for the paper’s reference distribution. An observed zero contributes nothing. The paper assumes that an expected zero is accompanied by an observed zero, as required for the comparison.

```
G ≈ χ²(n − 1)  in distribution
```

Here G is the likelihood-ratio statistic, χ² denotes the chi-square family, n is the number of classes in the comparison, and n − 1 is the number of degrees of freedom. The approximation sign refers to the sampling distribution of the statistic under suitable assumptions when coverage is random. A larger statistic marks a stronger departure from the expected counts. The user’s significance threshold sets how large the departure must be for the candidate to qualify.

For prediction, the most frequent covered class still supplies the rule’s conclusion. The significance calculation has a different purpose. A skewed distribution can be predictable simply because the same class dominates everywhere. A condition earns its place by identifying a sufficiently distinctive group, with entropy determining which qualified condition the procedure prefers. The overall result is a search that can retain short useful rules even when their covered examples include some exceptions.

#### What the comparison procedures learn

ASSISTANT builds a decision tree with a class at each leaf. It evaluates attribute tests with an entropy-based criterion and divides examples among the branches of the chosen test. If its stopping criterion is met, it labels the leaf with the most common class among the examples at that point. With pruning enabled, its cutoff estimates whether another branch would harm predictive accuracy. The paper describes this estimate as having no user-set parameter. Running the tree learner with and without that cutoff gives the authors a way to examine the value of stopping growth earlier.

AQR constructs a separate cover for each class. A cover is a disjunction, so it is true when at least one of its component complexes holds. The search begins with an uncovered positive example chosen as the seed. It takes nearby negative examples first, using the number of differing attributes as distance. For a selected negative case, it considers tests that retain the seed and exclude that case. Conditions that are unnecessary because a more general condition already covers their cases are discarded, and the star is pruned to the allowed size. If a negative example has precisely the seed’s attribute values, AQR skips it because the available tests cannot distinguish the pair.

AQR ranks finished complexes by how many positives they cover. While trimming the star, it rewards both positive examples covered and negative examples excluded. Shorter conditions break ties. Once the search selects a complex, it adds it as another alternative in the cover and moves on to the remaining positive examples. When several class covers match a new case, the system resolves the conflict using the class frequencies in the training examples covered by the applicable rules. When there is no match, it uses the most frequent training class. CN2 therefore shares AQR’s general idea of bounded search over complexes while differing in which refinements it explores, which conditions it accepts, and how its rules are executed.

The Bayesian classifier estimates how often each attribute value occurs within each class. At prediction time, it combines those frequencies with estimates of the class frequencies and chooses the class with the highest resulting probability. Its implementation examines every attribute for a case. The calculation relies on conditional independence, which means that once the class is given, the joint probability of the attribute values is obtained by multiplying their separate probabilities.

```
p(Cᵢ ∣ ⋀ⱼ vⱼ) = p(⋀ⱼ vⱼ ∣ Cᵢ) p(Cᵢ) / ∑ₖ [p(⋀ⱼ vⱼ ∣ Cₖ) p(Cₖ)]
```

The symbol p denotes probability. Cᵢ is the class whose probability is being evaluated, vⱼ is the recorded value of attribute j, and ⋀ⱼ vⱼ means that the entire set of recorded values occurs together. The vertical bar ∣ means “given.” The numerator multiplies the probability of those values given class Cᵢ by that class’s prior probability p(Cᵢ), estimated from training labels. The index k runs over the candidate classes in the denominator, and ∑ₖ adds the corresponding products. This denominator normalizes the results across classes.

```
p(⋀ⱼ vⱼ ∣ Cₖ) = ∏ⱼ p(vⱼ ∣ Cₖ)
```

On the left is the probability of the joint attribute values given class Cₖ. The product sign ∏ⱼ multiplies over the attributes indexed by j. Each factor p(vⱼ ∣ Cₖ) is the estimated probability of the observed value of attribute j within class Cₖ. A table of frequencies estimated from the training cases supplies these factors.

```
p(Cₖ) × (1/N)
```

This is the replacement used when an entry in the conditional-probability table is estimated as zero. In this expression N is the number of training examples, p(Cₖ) is the estimated prior probability for class Cₖ, and × denotes multiplication. The reciprocal 1/N makes the replacement smaller as training data increase. The adjustment keeps a single unobserved class-and-value combination from forcing the entire product to zero. The simplest comparison procedure uses just the most frequent training class and skips the calculation with attributes altogether.

### Experiments and results

#### What counted as a good result

The paper evaluates accuracy on cases held out during induction. For each run, a system sees the training examples, constructs its description and predicts the classes of the test cases. Accuracy is the percentage of those predictions that agree with the recorded labels. Training accuracy is also reported for selected settings, so the reader can see whether a description that closely fits the sample delivers similar accuracy on the held-out cases.

The authors use separate structural measures for the different representations. For ASSISTANT, complexity is the number of tree nodes, including leaves. For CN2 and AQR, it is the number of selectors in the rule list or rule set. The majority-class procedure is assigned a complexity of one, by analogy with a tree consisting of a single leaf. For the Bayesian procedure, the authors report the size of the conditional-probability matrix. With a attributes, an average of v values per attribute and n classes, they express that size as follows.

```
a × v × n
```

Here a counts attributes, v is the average number of values available per attribute, n counts classes, and × denotes multiplication. The authors treat this measure as an approximation to the amount of material a reader would have to inspect. A matrix with a few prominent entries may be easier to understand than its size suggests. Similar caution applies when comparing a selector with a tree node. The reported counts indicate how much structure was induced in each representation, and the comparison between settings of the same system has the clearest unit.

The Institute of Oncology at Ljubljana’s University Medical Center supplied the medical data. For each test, 70% of the examples were randomly selected for training and the remaining 30% were used for testing. All the algorithms trained and tested on the same cases within a run. The authors averaged five runs per domain. CN2 and AQR both used a maximum star size of 15. CN2 was tested with thresholds of 90%, 95% and 99%. ASSISTANT was tested with its pruning procedure enabled and disabled.

#### Lymphography

The lymphography task concerned classifying patients with suspected cancer from the available findings. Separating patients who were healthy from those with metastases or malignant lymphoma motivates the task. The dataset contained 148 examples in 4 classes, with class counts of 2, 81, 61 and 4. Examples of different classes always differed in at least one attribute. This left open the possibility of distinguishing the training cases from their recorded values. The authors note that the records had received less checking than those for the other medical tasks, so mistakes in attribute values could still be present.

Average held-out accuracy on the lymphography data The Bayesian classifier leads, with the strictest CN2 setting close behind.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Majority-class default | 56% |
| ASSISTANT, unpruned | 79% |
| ASSISTANT, pruned | 78% |
| Bayesian classifier | 83% |
| AQR | 76% |
| CN2, 90% threshold | 78% |
| CN2, 95% threshold | 81% |
| CN2, 99% threshold (this paper) | 82% |

Lymphography supplies the paper’s clearest example of compact rule induction. At the 99% threshold, CN2 had a reported average complexity of 12 selectors. The authors describe the resulting lists as averaging eight rules, with 1.6 selectors per rule. At the 90% threshold, average complexity was 24 selectors. Pruning reduced ASSISTANT’s average tree from 41 nodes to 36 nodes, with a small change in test accuracy. AQR averaged 76 selectors in its learned descriptions. The Bayesian classifier’s leading accuracy establishes that the compactness observed for CN2 and its predictive standing are separate findings.

The training comparison gives additional context. AQR achieved 100% average training accuracy and 76% average test accuracy. Pruned ASSISTANT achieved 98% on training cases and 78% on test cases. CN2 at the 99% threshold had 91% training accuracy and 82% test accuracy. The stricter CN2 rules left more training cases incorrectly classified, and their average accuracy remained relatively close across the two splits. The Bayesian procedure reached 89% on training cases and 83% on test cases, illustrating that good held-out accuracy was available through a different representation as well.

#### Breast cancer recurrence

The second task asked whether breast cancer would recur within five years of surgery. The data contained 286 cases in 2 classes, with counts of 85 and 201. The authors describe the recurrence rate as about 30%. The records had been checked after collection, so they expected fewer recording errors than in lymphography. Even with this checking, the attributes available to a learner might say little about the future outcome.

Average held-out accuracy on the breast cancer recurrence data The strictest CN2 setting matches the majority-class default, while AQR records the highest average.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Majority-class default | 71% |
| ASSISTANT, unpruned | 62% |
| ASSISTANT, pruned | 68% |
| Bayesian classifier | 65% |
| AQR | 72% |
| CN2, 90% threshold | 70% |
| CN2, 95% threshold | 70% |
| CN2, 99% threshold (this paper) | 71% |

The majority-class result sets the scale for this task. A substantial proportion of cases could already be predicted by always choosing the common outcome. At the strictest CN2 setting, the results discussion says the learner had difficulty finding significant clauses and points to this as evidence that the cutoff filters chance regularities. The structural table reports an average complexity of 4 for that setting, compared with 28 at the 90% threshold and 20 at the 95% threshold. The evidence supports a sharply reduced role for learned conditions at 99%. The structural count and the accuracy average do not identify the rule list from each individual split.

Pruning helped the tree in this domain. The pruned tree’s reported average complexity was 44 nodes, compared with 112 for the unpruned tree. Its 68% average test accuracy was also above the 62% achieved without pruning. AQR’s reported training accuracy was 100%, while its test accuracy was 72%. That held-out average was the highest in the table, but it was close to the 71% of the default. The experiment gives little evidence of a large predictive benefit from the extra conditions used to fit the training cases.

#### Primary tumor location

The final medical task was to predict a primary tumor’s location from information such as patient age, carcinoma type and possible sites of detected metastases. The data included 339 examples and 22 possible classes. The class frequencies were uneven, and Table 4 includes a class with no recorded examples. Cases assigned to different classes sometimes had exactly the same recorded attribute values. The authors describe the data as checked but the attribute set as relatively incomplete for the problem. A rule learner had to work within those descriptive limits.

Pruned ASSISTANT achieved 42% average test accuracy, the highest result for this task. The unpruned version achieved 40%, the Bayesian classifier 39%, and AQR 35%. The default was 26%. CN2 reached 37% at 90% and 36% at both 95% and 99%. At the strictest setting, its reported average complexity was 19 selectors. The pruned tree had 52 nodes on average, while AQR’s descriptions had 562 selectors. In this task, different choices could give a noticeably different amount of induced structure even when their accuracies remained in a relatively narrow range.

AQR attained 75% training accuracy for primary tumor location. CN2 at 99% attained 37%. The greater fit to the training records did not carry over to higher test accuracy for AQR. Pruned ASSISTANT, with 53% training accuracy and 42% test accuracy, obtained the best test result without attaining AQR’s training score. Across the medical tasks, the ranking therefore depends partly on the data. The highest lymphography performance came from the Bayesian classifier, and the highest primary tumor performance came from the pruned tree.

#### Artificial data with controlled corruption

The synthetic experiment used A1 and A2. Both domains contained 200 examples described by 12 attributes, with the examples evenly divided between the classes. In A1, each attribute could take 2 values. In A2, each could take 8. The target for one class was a conjunction of attribute-value tests, and the other class consisted of cases that failed that conjunction. Both CN2 and ASSISTANT could express the intended distinction compactly.

Half of the examples were used for training and half for testing, with results averaged over five trials. At a given noise setting, the authors randomized the designated proportion of training values. Each possible replacement value of the chosen attribute was equally likely. The class label was eligible for randomization in the same way as the attributes, and a random draw could return the original value. The nominal noise percentage is therefore a description of the randomization procedure. Test examples were kept clean, so the measured prediction accuracy reflects how well the systems recovered the uncorrupted distinction after learning from noisy cases.

Average clean-test accuracy in A2 with 20% training noise Both settings of ASSISTANT outperform CN2 at this training noise level.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| ASSISTANT, unpruned | 85% |
| ASSISTANT, pruned | 85% |
| CN2, 99% threshold (this paper) | 73% |

In A1 with 0% training noise, CN2 achieved 95% overall test accuracy and an average complexity of 3 selectors. Both ASSISTANT settings achieved 99% accuracy with a complexity of 8 nodes. At 20% training noise, overall CN2 test accuracy was 73%, while the pruned tree achieved 84%. The average complexity reported for CN2 at that noise level was 20 selectors, and the pruned tree had 27 nodes. Thus, even with a compact target concept available, the learner’s behavior depended on how it searched and how it decided to stop.

In A2 with 0% training noise, CN2 achieved 93% overall test accuracy with 8 selectors. Both tree settings achieved 99% and had 6 nodes. By 40% training noise, A2 test accuracy was 68% for CN2 and 75% for either tree setting. The reported average complexities at that noise level were 15 selectors for CN2 and 33 nodes for either tree setting. The two complexity units reflect different representations. Within each one, the counts show how the training corruption altered the amount of structure induced.

At 100% noise in A2, CN2’s overall test accuracy was 50%, and the authors say its description converged on the default alone. Both tree settings recorded 55% test accuracy. In A1 under 100% noise, CN2 still induced conditional rules and achieved 45% overall test accuracy. A fully randomized training set makes the remaining rules especially informative as a test of the cutoff. Any apparent relationships there come from the particular randomized sample. The algorithms’ response shows whether their stopping procedures can decline to retain those relationships.

#### Computational cost

The analysis separates the cost of a basic learning operation from the cost of an entire run. The authors assume binary attributes and two classes for the critical-operation bounds. In that setting, selecting a branching attribute for ASSISTANT involves collecting counts for the candidate attributes, evaluating those counts and allocating the examples to the chosen branches. For the Bayesian classifier, the corresponding work is compiling attribute-value counts within classes.

```
O(a · e)
```

Here O denotes an asymptotic upper bound, a is the attribute count, e is the number of examples, and the centered dot denotes multiplication. For ASSISTANT, this is the bound for selecting a test at a node in the simplified analysis, which leaves out the cutoff procedure. For the Bayesian implementation, the paper uses the same bound for generating the probability matrix, an operation performed once. The authors give a separate bound for extensions to tree induction that have to sort examples by real-valued attributes.

```
O(a · e log e)
```

Here a and e again count attributes and examples. The symbol log denotes a logarithm, whose base does not affect the order bound. The factor involving log e accounts for sorting by attribute value. The bound is for the attribute-selection operation when the preliminary sort is required.

For CN2 and AQR, the corresponding critical operation builds a new star. The work includes generating refinements, evaluating them and ordering them so the weakest can be dropped. AQR also has to find a covered negative case and identify tests that separate it from the seed. The authors give the same order bound for the basic star operation in both systems.

```
O(a · s(e + log(a · s)))
```

Here a counts attributes, s is the maximum star size, and e counts examples. The parentheses group the work proportional to the example count with the logarithmic factor for sorting candidates. At fixed attribute count and beam width, this expression is linear in the number of examples. A complete run can have many such operations, both within the search for a condition and across the rules in the list. The paper gives the following worst-case bound for CN2 when it can induce e rules of length a.

```
O(a² · e² · s)
```

Here a² and e² are the squares of the attribute and example counts, and s is the maximum star size. The authors give a similar worst case for AQR. For ASSISTANT, the tree depth in the simplified analysis is bounded by the number of attributes, and the examples at each level are distributed among the nodes at that level. The paper gives this total bound for the tree calculation.

```
O(a² · e)
```

Here a² is the squared number of attributes and e is the number of examples. This bound and the bound for the choice at a single node answer different questions. Much of CN2’s practical interest lies in whether its cutoff keeps the number and length of accepted rules small enough to avoid the expensive cases allowed by its full bound.

The measured runtimes are for lymphography on a Sun 3/75. CN2 took 15 minutes and AQR took 170 minutes, both in Prolog with the same maximum star size. ASSISTANT, implemented in Pascal, took one minute. Building the Bayesian matrix took a few seconds. The authors interpret the ordering as an indication of the relative work their procedures did. The figures come from implementations with different languages and methods, so the elapsed times alone give limited evidence about the algorithms’ relative speeds under comparable implementation conditions.

### What the ablations show

#### Raising the threshold for accepting a rule

The threshold sweep changes the evidence CN2 requires while retaining its rule representation, search heuristic and beam width. In lymphography, the average complexity at the 90%, 95% and 99% thresholds was 24, 22 and 12 selectors, respectively. Test accuracy at those settings was 78%, 81% and 82%. The stricter criterion coincided with fewer selectors and a higher average test score. The comparison supports the idea that some conditions accepted under a looser criterion were unnecessary for good predictions in this domain.

On the recurrence task, increasing the threshold also lowered the reported complexity while the accuracy averages stayed close. The default performed equally well as the strictest setting at the level of average test accuracy. This is a case where small descriptions are especially relevant. If the available attributes offer weak distinctions, an algorithm can add a substantial amount of structure while gaining little over a common-class prediction. The cutoff controls that growth even when it has little effect on the overall error rate.

Primary tumor location shows that complexity need not move smoothly with the threshold. CN2’s average counts were 33 selectors at 90%, 42 at 95% and 19 at 99%. The intermediate threshold produced more selectors than the looser threshold. A change to the set of acceptable conditions can change which rule is selected early, which cases it removes and which distributions later searches see. The construction therefore supplies a reason to expect that stricter admission can alter the entire list, with effects beyond removing some rules from a previously learned list. The reported averages reveal the pattern without tracing every choice that produced it.

#### Turning tree pruning on and off

The comparison between the two ASSISTANT settings tests a related stopping idea in a different representation. On the breast cancer recurrence data, the pruned version had higher average test accuracy and much smaller trees by the node count. It showed a similar pattern in the primary tumor domain, where it reached 42% with 52 nodes and the unpruned setting reached 40% with 178 nodes. On lymphography, the pruned version was a little less accurate, with a smaller reduction in size. The value of early termination thus depends on the domain and on which criteria the reader compares.

A2 shows a different outcome. The authors found that the pruning procedure did not cut any of the trees in that domain. The pruned and unpruned settings therefore report the same results there. This is useful evidence about the cutoff itself. Providing a pruning option does not ensure the learner will apply it where the experimental setup makes added complexity undesirable. Its effect depends on whether the conditions for pruning are met as the tree is grown.

AQR supplies a further contrast through its pursuit of training consistency. It reached 100% training accuracy on lymphography and on breast cancer recurrence, with much lower test accuracy. For primary tumor location, it also had the highest training score among the versions compared in the training-and-test table, while its test score was below the pruned tree and CN2. This suggests that accepting exceptions can be preferable to building rules that absorb every distinction present in a sample. The comparison combines several differences, including the method for choosing refinements, the decision to pursue a particular class, and the treatment of overlapping rules. It measures those systems as complete procedures.

#### Changing which cases the accuracy covers

The artificial experiments report a second accuracy measure for CN2. It considers only test cases classified by a learned conditional rule, leaving out cases handled by the default. Overall accuracy answers how well CN2 classifies the complete test set. The restricted measure answers how trustworthy the conditional part of the list was on the cases it actually handled. Its interpretation depends on the fact that the two measures have different denominators.

In A1 at 20% training noise, the non-default accuracy was 86% and overall accuracy was 73%. In A2 at 40% training noise, the non-default accuracy was 82% and overall accuracy was 68%. The higher restricted scores show that, in these settings, the learned conditions covered a subset for which the assigned classes were relatively reliable. The remaining cases, still part of the classification task, lowered the full-list accuracy when they were assigned the default. The conditional score alone gives no count of how many test cases reached the default.

The authors relate this distinction to expert review. A specialist examining the list may be most interested in whether a conditional clause describes a repeatable pattern among the records to which it applies. The default serves the broader operational requirement that the procedure can always return a class. Because lower rules are reached only after earlier conditions fail, the restricted accuracy measures the conditional portion of the list in its actual order. It does not evaluate the isolated accuracy of each rule when applied independently to every test case.

#### Seeing what happens when the signal disappears

The noise experiment probes the behavior of the stopping mechanisms as the training distribution ceases to reflect the intended concept. At intermediate noise levels, meaningful patterns can coexist with accidental ones. At 100% randomization, the authors expect the proper decision procedure learned from the training data to shrink to a constant prediction. A complicated description under this condition is evidence that the learner has treated accidental structure as worth keeping.

CN2 met that expectation in A2 and failed to meet it in A1. The authors explain the difference through the number of conditions considered and the amount of coverage those conditions usually obtain. Tests on attributes with fewer possible values can leave a reasonably large group after several selectors are combined. Broad search then gives many opportunities for a condition with enough cases to display an apparently unlikely class imbalance. With more possible values per attribute, comparable conjunctions tend to cover fewer examples. Those small groups in A2 gave the significance check less evidence to act on under full randomization.

The point concerns which candidate is being tested. CN2 searches through many conditions before retaining the one that looks strongest among those it can use. The observed class imbalance of that selected condition is the result of a deliberate search for unusual groups. A threshold based on random selection of examples can still admit a striking group found in this way. The A1 result exposes that weakness directly. In the same controlled experiment, ASSISTANT also retained structure when randomization was complete, showing that its stopping mechanism could be misled under the tested conditions.

The paper explains its preference for entropy with a distribution example and its observations about low-entropy candidates. It gives no corresponding experiment in which a majority-proportion score replaces entropy while other choices are held fixed. Similarly, the synthetic study varies the amount of corruption and the number of possible attribute values while keeping the reported CN2 threshold at 99%. The evidence directly concerns the threshold sweep on the medical tasks, the tree cutoff comparison and the response to controlled noise. The relative contribution of entropy, beam width and list order remains open within those results.

### Limitations

#### Limits identified by the authors

The authors identify the significance test as the clearest candidate for improvement. A stringent threshold helped produce small descriptions in the medical tasks, yet it let some patterns through in fully randomized A1. Its behavior depended on properties of the domain, including the coverage that a typical conjunction could attain. The authors wanted a criterion more sensitive to those properties. The result also limits what the threshold label means in practice. A setting of 99% identifies the chosen reference cutoff for candidate evaluation. The experiment shows that it cannot be read as a guarantee about the reliability of every rule found by the whole search.

They also qualify the comparison with AQR. Basic AQ was designed around finding descriptions that account for the training examples, and practical AQ systems use additional procedures before or after induction. AQR intentionally reconstructs a straightforward version of the central search. Its large rule sets and training-to-test gap reveal what can happen when that search is used on its own. The authors point to AQ15 results with rule pruning and flexible matching that were similar to CN2 and ASSISTANT in complexity and accuracy. Their own randomized medical splits differed from the splits used in the AQ15 work, so that comparison is contextual.

Comprehensibility is another limit the paper states plainly. The authors count selectors and nodes because those features are available for inspection and provide a rough measure of how much has been learned. They acknowledge that different descriptions are hard to compare and that judgments of complexity involve subjectivity. Rule order complicates interpretation, because the meaning of a decision lower in the list depends on which earlier decisions exclude the case. The authors nevertheless see a practical benefit in explicit priority for interactive use, especially compared with more elaborate conflict resolution. Their experiment measures structure and prediction, leaving the benefit for a person examining the rules as a proposed practical advantage.

The runtime analysis also has an explicit scope. The theoretical comparison of basic operations assumes binary attributes and two classes, and the paper omits some costs, such as ASSISTANT’s cutoff procedure. Total induction time depends on how much the system grows its tree or rule list. The measured timings reflect particular implementations. The Bayesian comparison has a related qualification. Its competitive scores in the medical tasks coexist with an independence assumption that the paper does not establish for those data. The authors leave open how sensitive that classifier is to violations of the assumption.

#### Limits visible in the study design

The medical experiments provide repeated held-out measurements, averaged over five random splits. They show broad contrasts, such as the high accuracy obtained by a majority prediction for recurrence and the large reduction in selectors obtained by tightening CN2’s cutoff. The averages offer less resolution for the ordering of systems with close results. The main accuracy table supplies no variation across splits. A reader can therefore report which average is higher while leaving open how consistent that ordering would be across different samples.

Accuracy also aggregates outcomes across classes. This matters when class frequencies differ considerably. On breast cancer recurrence, always predicting the common outcome reaches 71% test accuracy, although such a decision procedure cannot distinguish which individual cases are likely to recur. On primary tumor location, the table provides a common yardstick across many classes, but offers no per-class performance for the learners. The reported figures support claims about matching labels across the test set. The ability to identify uncommon outcomes or be used in a clinical decision remains unmeasured.

The artificial domains support a focused conclusion about corruption in training. The class boundary is a conjunction or its complement, and noise is introduced by randomizing individual values, with the possibility of randomizing the class. The test data retain the original signal. A medical collection can depart from its underlying regularities through other processes, such as systematically missing distinctions or repeated recording mistakes. The synthetic study isolates a clear mechanism and makes failures under complete randomization easy to identify. It offers limited grounds for predicting how the same cutoff would behave with a different target structure or different source of error.

There is also a distinction between obtaining a concise decision list and obtaining the shortest or most accurate description available. A bounded beam can discard a condition whose best refinement would have been useful. Removing covered cases fixes the priority of the chosen rules before later searches occur. The algorithm produces the list that results from those choices, with no global comparison of all possible rule orders. The reported complexity shows how much structure CN2 produced in these experiments. Establishing optimality would require a criterion and a search capable of certifying it.

### What came after

The later papers citing CN2 take up questions that its original experiments bring together. One concerns why people should be able to inspect a learned decision procedure. Another concerns whether an ordered list can be found with a stronger guarantee about its quality. A third concerns what rules can express when the classification problem involves language. The titles and scope of these works establish those connections. They leave the details of direct algorithmic reuse open.

The broadest connection is with work that frames interpretability through principles and research challenges. Clark and Niblett ask for a decision procedure that a specialist can read and judge, and their experiments use structural counts as an indirect measure of that aim. The later work places interpretability at the center of the inquiry. That change in emphasis makes a distinction in CN2’s evaluation especially visible. A compact output is easy to count, while the value of that output to the person making a decision is a separate question. Interpretable Machine Learning

Work on certifiably optimal rule lists addresses a question about the same general kind of output as CN2. CN2’s heuristic search chooses a condition from the refinements it considers and commits to its position in the list. A certifiable optimization problem asks for a guarantee about the list obtained for categorical data under a specified criterion. This connects to the original paper’s decision to use efficient heuristics when exhaustive search for compact descriptions is impractical. The subject carried forward is the rule list itself, along with a stronger requirement on how the learner justifies its choice. [Learning Certifiably Optimal Rule Lists for Categorical Data](https://md.research.elamur.ai/free/en/papers/angelino-2017-learning-certifiably-optimal-rule-lists/)

The work on Turkish morphological disambiguation takes learned rules into a linguistic decision problem. In that setting, disambiguation concerns choosing among possible analyses of a word’s form. The connection to CN2 is the use of learned conditions to make a distinction that can be stated as a rule. The task changes what the labels represent, from outcomes or diagnoses in the medical experiments to distinctions between linguistic analyses. It shows the scope of questions later rule-learning work could address in [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/). [Learning Morphological Disambiguation Rules for Turkish](https://md.research.elamur.ai/free/en/papers/yuret-2006-learning-morphological-disambiguation-rules-turkish/)

## Cite

Cite as Peter A. Clark and Tim Niblett. 1989. The CN2 Induction Algorithm. Machine Learning.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1007/bf00116835](https://doi.org/10.1007/bf00116835)

```bibtex
@inproceedings{clark1989cn2,
  title = {{The CN2 Induction Algorithm}},
  author = {Peter A. Clark and Tim Niblett},
  booktitle = {Machine Learning},
  year = {1989},
  doi = {10.1007/bf00116835},
  url = {https://doi.org/10.1007/bf00116835}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
