WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Extracting decision rules from J48 --Weka--

Re: Extracting decision rules from J48 --Weka--

by iness :: Rate this Message:

| View in Thread

Hello,
I have the same problem..And I want to know if there is method associated to the J48 tree.
In the same context, we can extract these rule with the treatement of string ( concat, substring,...).
Best regards
ibn86 wrote:
Hello,

I have a problem. I must do a java application which uses some classes of the .jar file weka-src.jar. I must in a first step extract decision rules from J48 algorithm ( which generate a tree decision). In the package of J48 algorithm on Weka, the class ClassifierTree (in the file ClassifierTree .java) has two methods called "dumpTree" and "ToString" which generate decision rules as an output text in the "Classifier output" of Weka.
For example
outlook = sunny
|   humidity <= 75: yes (2.0)
|   humidity > 75: no (3.0)
o7
utlook = overcast: yes (4.0)
outlook = rainy
|   windy = TRUE: no (2.0)
|   windy = FALSE: yes (3.0)

However, when I searched for a way to extract these rules as  "Condition:Conclusion" (specialy, I wantto extract each complete condition from these rules displayed), I can't. ( for example, the first rule must be extarcted like this: outlook=sunny humidity<=75:yes. In other words, I must extract all the items of the conditional part ( the one before the char '|' and these after.

Does any one know how to modify source code of J48 package (classes especialy the Tree classifier.java) in order to extract decision rules resulted from tree generated ( is there a method in the package J48 to be modified in order to have decision rules)?

Thanks in adavance.

Best regards,
8-7-945

 « Return to Thread: Extracting decision rules from J48 --Weka--