@@ -136,57 +136,3 @@ Logistic regression wins in area under ROC curve::
136136 tree knn logreg
137137 Accuracy 0.79 0.47 0.78
138138 AUC 0.68 0.56 0.70
139-
140-
141- Rule induction
142- --------------
143-
144- To induce rules from examples, separate and conquer strategy is applied.
145- In essence, learning instances are covered and removed following a
146- chosen rule. The process is repeated while learning instances remain. To
147- evaluate found hypotheses and to choose the best rule in each iteration,
148- search heuristics are used (primarily, rule class distribution is the
149- decisive determinant). The over-fitting of noisy data is avoided by
150- preferring simpler, shorter rules even if the accuracy of more complex
151- rules is higher.
152-
153- The use of the created module is straightforward. New rule induction
154- algorithms can be easily introduced, by either utilising predefined
155- components or developing new ones (these include various search
156- algorithms, search strategies, evaluators, and others). Several
157- well-known rule induction algorithms have already been included.
158-
159- Unordered CN2
160- +++++++++++++
161-
162- Unordered CN2 inducer (:any: `CN2UnorderedLearner `) constructs a set of
163- unordered rules. Rules are learnt for each class individually, in regard
164- to the original learning data. To evaluate found hypotheses, Laplace
165- accuracy measure is used. Returns a CN2UnorderedClassifier if called
166- with data.
167-
168- The code below loads the *iris * data set (four continuous attributes
169- and a discrete class) and fits the learner.
170-
171- .. literalinclude :: code/classification-cn2ruleinduction1.py
172-
173- Having first initialised the learner, we then control the algorithm by
174- modifying its parameters. The underlying components are available to us
175- by accessing the rule finder. The search algorithm can additionally be
176- constrained by forwarding base rules upon learner initialization (see
177- code reference).
178-
179- The classifier is used to predict data instances.
180-
181- >>> classifier(data.X[50 :55 ])
182- [1 1 0 1 1]
183-
184- Induced rules can be quickly reviewed and interpreted. They are each of
185- the form "if cond then predict class". That is, a conjunction of
186- selectors followed by the predicted class.
187-
188- >>> for rule in classifier.rule_list[:3 ]:
189- >>> print (rule, rule.curr_class_dist.tolist())
190- IF petal length<=3.0 AND sepal width>=2.9 THEN iris=Iris-setosa [49, 0, 0]
191- IF petal length>=3.0 AND petal length<=4.8 THEN iris=Iris-versicolor [0, 46, 3]
192- IF petal width>=1.8 AND petal length>=4.9 THEN iris=Iris-virginica [0, 0, 43]
0 commit comments