29 Jun 2012 08:55
J48 cleanup option
Can Eren <caneren.accs <at> gmail.com>
2012-06-29 06:55:47 GMT
2012-06-29 06:55:47 GMT
Hello everyone, I am using WEKA Developer API to do some machine learning. I am using J48 as a classifier. After training my tree, I need to access to the instances placed under the leaf nodes. Which means i need to set "setReducedErrorPruning()" to true. I stumbled upon a problem where if I set the option to keep the instance data in the classifier while also turning on reduced error pruning, I get a null pointer exception in C45Split class when trying to visualize the tree and the classifier contains "Can't print classification tree" notation: Classifier Model J48 pruned tree ------------------ Can't print classification tree. If I disable the setting for keeping the instance data but leaving the reduced error pruning option enabled, then the tree is displayed. But then, I can't see the instances in the leaves. There are other scenarios where disabling reduced error pruning can also lead to an exception if saving instances is enabled. So the following settings will throw an exception: aTree.setSaveInstanceData(true); aTree.setUnpruned(false); aTree.setReducedErrorPruning(true); aTree.setNumFolds(3); aTree.setSeed(1);(Continue reading)
RSS Feed