2

I want to save the clusterer (Cobweb) results to an arff file, but I can't seem to figure it out. I know how to save the results from GUI, but I cant figure out how to do it from my java code, even after searching for a couple of hours.

Here is my code.

ArffLoader loader = new ArffLoader();
loader.setFile(new File(sourceFile));
Instances structure = loader.getStructure();

Cobweb cw = new Cobweb();
cw.buildClusterer(structure);
Instance current;
while ((current = loader.getNextInstance(structure)) != null)
     cw.updateClusterer(current);
cw.updateFinished();

mleko
  • 11,650
  • 6
  • 50
  • 71
scarleth ohara
  • 357
  • 2
  • 12
  • possible duplicate of [Using Weka on command line to generate cluster assignment arff file](http://stackoverflow.com/questions/5486767/using-weka-on-command-line-to-generate-cluster-assignment-arff-file) – Has QUIT--Anony-Mousse May 27 '13 at 19:03

1 Answers1

1

Have you tried using

weka.filters.unsupervised.attribute.AddCluster

which adds the cluster assignment to your data.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194