Module orngCN2 implements several variations of well-known CN2 rule learning algorithm and some additional functions to ease the work with rules described in the last section.
All variations of CN2 are implemented by by wrapping orange.RuleLearner
class. Note that orange.RuleLearner
class contains many replacable components. Each CN2 learner class in this module changes some of these components to reflect the required behaviour. Thus, in the description of each class, we mention only components that differ from default values (see Rule Learning).
CN2Learner
is a class that implements classical CN2 (see Clark and Niblett; 1988). It learns a set of ordered rules, which means that classificator must try these rules in the same order as they were learned.
Specific components
orange.RuleLearner
.
CN2UnorderedLearner
class implements CN2 unordered (see Clark and Boswell; 1991). It learns a set of unordered rules - classification from rules does not assume ordering of rules - and returns a CN2UnorderedClassifier
. In fact, learning rules is quite similar to learning in classical CN2, where the process of learning of rules is separated to learning rules for each class, which is implemented in class' __call__
function. Learning of rules for each class uses a slightly changed version of classical CN2 algorithm.
Specific components
orange.RuleEvaluator_Laplace
CN2SDUnorderedLearner
class implements CN2-SD (see Lavrac et al.; 2004). It learns a set of unordered rules, which is the same as CN2UnorderedLearner
. The difference between classical CN2 unordered and CN2-SD is selection of specific evaluation function and covering function, as it is mentioned in Specific components section.
Specific components
WRACCEvaluator
class that implements weighted relative accuracy.CovererAndRemover_multWeights
with multiplication factor set to 0.7. Alternative class for "weighted" covering is CovererAndRemover_addWeights
that follows the principle of additive correction of weights. ruleToString
rule
which is obvious and the second is showDistribution
for selecting whether presentation should also contain the distribution of covered examples.
WRACCEvaluator
mEstimate
m
.
CovererAndRemover_multWeights
mult
.
CovererAndRemover_addWeights
Clark, Niblett. The CN2 Induction Algorithm. Machine Learning 3(4):261--284, 1989.
Clark, Boswell. Rule Induction with CN2: Some Recent Improvements. In Machine Learning - EWSL-91. Proceedings of the European Working Session on Learning., pages 151--163, Porto, Portugal, March 1991.
Lavrac, Kavsek, Flach, Todorovski: Subgroup Discovery with CN2-SD. Journal of Machine Learning Research 5: 153-188, 2004.