Re: "Can't find a permissible class" error

Ulrich Mayring <[email protected]> Wed, 3 Jul 2024 18:57:48 +0200
Newsgroups gmane.comp.ai.weka
Message-ID <[email protected]>
I now have the same problem. I am using Weka in my Java program and want 
to classify using RandomForest and I'm setting some options on that 
classifier. However, for some reason Weka internally sets those options 
to RandomForest's base classifier, which is RandomTree, and it doesn't 
know about those options and throws an Exception.

The funny thing is that this only happens when I run my program in a 
docker container, it does not happen when I run it from my IDE. How 
could that be that in some cases the options are set to the base 
classifier internally?

For sure, when I don't set any options on the RandomForest classifier, 
then this problem also does not appear - I can then classify without any 
errors.

Many thanks in advance for any pointers,

Ulrich


Am 15.05.20 um 01:53 schrieb Eibe Frank:
> This seems a bit strange because AdaBoostM1 is part of the WEKA core distribution and is included in weka.jar.
> 
> Can you create AdaBoostM1 objects elsewhere in your plug-in?
> 
> If you want to be able to access code from installed WEKA packages via your plug-in, you will need to get the WekaClassLoader to load all packages using
> 
> weka.core.WekaPackageManager.loadPackages(true)
> 
> Cheers,
> Eibe
> 
>> On 14/05/2020, at 11:47 PM, talberi <[email protected]> wrote:
>>
>> I'm working on integrating Weka into a Java plug-in I'm developing for
>> another application. To do this, I added weka.jar to the plug-in's build
>> path. So far, most things are working correctly. I can train classifiers and
>> evaluate data with them. The one thing I can't get working properly is the
>> GenericObjectEditor when setting classifier options.  For instance, when I
>> try to use it on an AdaBoostM1 classifier, I get an error message that
>> includes the following:
>>
>> WARNING: failed to copy option handler weka.classifiers.meta.AdaBoostM1 with
>> options -P 100 -S 1 -I 10 -W weka.classifiers.trees.DecisionStump --- trying
>> deep copy instead
>> java.lang.Exception: Can't find a permissible class called:
>> weka.classifiers.meta.AdaBoostM1
>> 	weka.core.ResourceUtils.forName(ResourceUtils.java:84)
>> 	weka.core.Utils.forName(Utils.java:1080)
>> 	weka.core.OptionHandler.makeCopy(OptionHandler.java:80)
>> 	weka.gui.GenericObjectEditor.makeCopy(GenericObjectEditor.java:1959)
>>
>> weka.gui.GenericObjectEditor$GOEPanel.copyObject(GenericObjectEditor.java:961)
>> 	weka.gui.GenericObjectEditor$GOEPanel.<init>(GenericObjectEditor.java:749)
>> 	weka.gui.GenericObjectEditor.getCustomEditor(GenericObjectEditor.java:1612)
>> 	weka.gui.PropertyDialog.initialize(PropertyDialog.java:150)
>> 	weka.gui.PropertyDialog.<init>(PropertyDialog.java:120)
>>
>> Looking at the Weka source code, I think this error traces back to the
>> WekaPackageClassLoaderManager class, which can't find the AdaBoostM1 class.
>> Is there any reason that I won't be able to find it? Do I need to do
>> something else with my build path for the loader manager to be able to find
>> the class?
>>
>> Thanks.
>>
>>
>>
>>
>>
>> --
>> Sent from: https://weka.8497.n7.nabble.com/
>> _______________________________________________
>> Wekalist mailing list -- [email protected]
>> Send posts to [email protected]
>> To unsubscribe send an email to [email protected]
>> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
>> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> _______________________________________________
> Wekalist mailing list -- [email protected]
> Send posts to [email protected]
> To unsubscribe send an email to [email protected]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> 


_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html