Can Eren | 29 Jun 2012 08:55
Picon

J48 cleanup option

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)

Mark Hall | 4 Jul 2012 10:15
Favicon

Re: J48 cleanup option

On 29/06/12 6:55 PM, Can Eren wrote:
> 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);
(Continue reading)

Can Eren | 4 Jul 2012 10:32
Picon

Re: J48 cleanup option

On Wed, Jul 4, 2012 at 10:15 AM, Mark Hall <mhall <at> pentaho.com> wrote:
> On 29/06/12 6:55 PM, Can Eren wrote:
>>
>> 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:
>>
(Continue reading)


Gmane