Re: MISMO Classifier: how to set Instance Weights?

Peter Reutemann <[email protected]> Thu, 4 Jan 2024 16:06:18 +1300
Newsgroups gmane.comp.ai.weka
Message-ID <CAHoQ12KSNAMTXpcUNKQo9jy=k9o5LZ2KZWL88Fz-NMyOkH=Lfw@mail.gmail.com>
> I have the following code:
>
> Instances instances = DataSource.read("/my/data.arff");
> MISMO classifier = new MISMO();
> instances.stream().forEach(instance -> instance.setWeight(1.0));
> classifier.buildClassifier(instances);
>
> This leads to the following error message:
>
> weka.filters.unsupervised.attribute.PropositionalToMultiInstance: Some
> instance weights are not equal to 1 and scheme does not implement the
> WeightedInstancesHandler interface!
>
> The stack trace:
>
> at weka.core.Capabilities.test(Capabilities.java:1307)
> at weka.core.Capabilities.test(Capabilities.java:1138)
> at weka.core.Capabilities.testWithFail(Capabilities.java:1468)
> at weka.filters.Filter.testInputFormat(Filter.java:474)
> at weka.filters.Filter.setInputFormat(Filter.java:492)
> at
> weka.filters.unsupervised.attribute.PropositionalToMultiInstance.setInputFormat(PropositionalToMultiInstance.java:391)
> at weka.classifiers.mi.MISMO.buildClassifier(MISMO.java:1290)
>
> What could I be doing wrong here?

Nothing. You seem to be running afoul of a capabilities code change
that occurred after the release of the PropositionalToMultiInstance
filter (which is used inside the MISMO classifier). The MIWrapper
classifier, for instance, doesn't have that problem.

The only workaround would be to disable the capabilities testing
framework altogether (which I'd normally not advise to do).
Create the file "Capabilities.props" in the $HOME/wekafiles/props
directory with the following content:
Test=true

Cheers, Peter
-- 
Peter Reutemann
Dept. of Computer Science
University of Waikato, Hamilton, NZ
Mobile +64 22 190 2375
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
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