Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weka Creating Instance Object error

Tags:

java

weka

I was looking a programmatic exampple of Weka from http://weka.wikispaces.com/Programmatic+Use . However, I think because of the version of my Weka jar (3.7.7), it gives error on this line:

 Instance iExample = new Instance(4);

 Error: Cannot instantiate the type Instance

What kind of change should I do on the code?

like image 257
Ahmet Tanakol Avatar asked Nov 20 '12 09:11

Ahmet Tanakol


1 Answers

Okay, according to this documentation Instance is an interface. Which is why your getting this error. You will need create one of the implementing classes eg,

Instance iExample = new DenseInstance(4);

Perhaps that example is out of date.

like image 140
The Cat Avatar answered Oct 03 '22 02:10

The Cat