KDnuggets : News : 2000 : n13 : item9    (previous | next)

Software

From: Kamran Karimi karimi@cs.uregina.ca (via ML-List)
Date: Tue 6/20/00 9:14 PM
Subject: C4.5 can now speak PROLOG
 This is to announce the availability of a patch to enable C4.5 to speak
Prolog. The patch file changes the c4.5rules program so that if the option
'-p' is given on the command line, a file stem.pl Prolog file is created
in addition to the normal output.

 It can generate code to handle rules involving equality (=), inequality
(>, =<) and set member ship (in).

 Some of the benefits of having C4.5's rules in Prolog are:

 *) The rules extracted by C4.5 can become part of a larger system, thus
    integrating neatly with other Prolog code. This could be of great help
    in expert systems for example.

 *) The rules can be executed by a Prolog interpreter in any order: from the
    condition attributes to the decisision attribute, from the decision
    attribute to the condition attributes, or from the decision attribute and
    certain condition attributes to other condition attributes. I've used
    operators and functions capable of "unification" to achieve this. For
    example, if the rule is: If {(A = 1) AND (B = 3)} then (class = 2) would
    become: class(A, B, 2) :- A = 1, B = 3. Since '=' is a unifying operator,
    a query like class(A, B, 2), which goes from the decision attribute back
    to condition attributes, works. The same holds for a "normal" query like
    class(1, 3, C), which determines the decision attribute.

 C4.5's rules can be turned into recursive rules by the introduction of the
decision attribute as a condition attribute. A very simple example is:
a(B, 1) :- a(_, 2), B = 1. (read: to get to class 1, get to class 2 and set B
to 1, or if B is already unified, check that B is 1). Prolog can readily tackle
such rules. We are working on interesting areas where this kind of usage makes
sense.

 You can download the patch file freely by anonymous FTP from
ftp://orion.cs.uregina.ca/pub/c4.5p/r8p.patch, or by contacting me. It is a
text file and should be applied to standard C4.5 Release 8 files with the
'patch' command. The new functionality is then available after a compile.

You can get C4.5's sources from http://www.cse.unsw.edu.au/~quinlan/
 I'd be happy to receive your comments/bug reports on the ideas and the
implementation.

Kamran Karimi
karimi@cs.uregina.ca
http://www.cs.uregina.ca/~karimi

KDnuggets : News : 2000 : n13 : item9    (previous | next)

Copyright © 2000 KDnuggets. Subscribe to KDnuggets News!