I'm trying to convert data X in MATLAB into a Weka Instance class. I'm using Weka 3.7.5 and MATLAB 7.10 (2010a).
I've tried the following:
javaaddpath([WEKA_HOME 'weka.jar']);
import weka.core.*;
N = 3;
inst = Instance( N );
And I receive the error
??? No constructor 'weka.core.Instance' with matching signature found.
When I type which Instance, it is able to find this class. Also, this form of the constructor agrees with the one documented here.
I'm inexperienced with calling Java from MATLAB, so it's likely I'm missing something simple here. Thanks!
Updates:
Tried casting N to an int32, but no luck, still same error.
I tried this with an older version of Weka ( ver 3.5.8 ) and it worked. Can't explain why though.
I found updated documentation : which tells me that Instance is now an interface rather than a class like it was in the documentation I was looking at. So I guess my question is now, can I instantiate this like I do a class? Sorry for confusing this initially..
Use class DenseInstance instead of Instance. It's an implementation of the Interface in 3.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With