Search code examples
javaweka

Provide training set and unlabelled set for weka


Input and output format in weka has brought a big headache for me, as it only seems to take input from .arff and .cvs file. How do I directly convert java objects into Instances? Right now I am just writing Java objects into a .arff file and then read the file into weka Instances. Is this the right way to do it?


Solution

  • This link (in part) describes creating an Instance object. Instead of writing your data to a .arff file and then reading it, you can skip the middle man.

    You may find this question (Define input data for clustering using WEKA API) helpful for a concrete example of creating an Instances object from Java.