CN2 Rule Learner

CN2: A widget for learning an unordered set of classification if-then rules.

Channels

Inputs

Examples (ExampleTable)

Outputs

Learner (orange.Learner)
Classifier (orange.Classifier)
A rule classifier induced from given data.
CN2UnorderedClassifier (orngCN2.CN2UnorderedClassifier)
The same as "Classifier".

Description

Use this widget to learn a set of if-then rules from data. The algorithm is based on CN2 algorithm, however the variety of options in widget allows user to implement different kinds of cover-and-remove rule learning algorithms. CN2 Widget

In the first box user can select between three evaluation functions. The first, Laplace, was originally used in CN2 algorithm. The second function is m-estimate of probability (used in later versions of CN2) and the last is WRACC (weighted relative accuracy), used in CN2-SD algorithm.

In the second box user can define pre-prunning of rules. The first parameter, Alpha, is a parameter of LRS (likelihood ratio statistics). Alpha determines required significance of a rule when compared to the default rule. The second parameter, Stopping Alpha, is also the parameter of LRS, only that in this case the rule is compared to its parent rule, namely, it verifies whether the last specialization of the rule is significant enough. The third parameter is used to specify minimum number of examples that each induced rule must cover, and the last parameter is used for limiting maximum length of rules.

Beam width in the third box is the number of best rules that are, in each step, further specialized. Other rules are discarded.

Covering and removing examples can be done in two different ways. Exclusive covering, as in the original CN2, removes all covered examples and continues learning on remaining examples. Alternative type of covering is weighted covering, which only decreases weight of covered examples - it does not fully remove them. The parameter of weighted covering is "multiplicator"; the weights of all covered examples are multiplied by this number.

Examples

The figure shows a simple use of CN2 in Canvas. Rules are learned with CN2 widget and the classifier is sent to our Rules Viewer Widget. CN2 - Interaction