Output weka results to text file

8.7k views Asked by At

I am new to Weka GUI and i want to output a list of correlations on different fields to a .txt file. My arff file is correct. Can anyone help ?

I have already managed it using the art writer with the api, but i can't seem to find from where using the guy.

2

There are 2 answers

0
webneko On BEST ANSWER

In the "classify" tab there is a box in the bottom left with the Results list. Right click on the test you want to save, click on "save result buffer", select the location and name it whatever.txt. It will save the results of whatever test you ran as a .txt file.

0
sheldonzy On

If anyone is not using the GUI, but with code -

import java.io.BufferedWriter;
import java.io.FileWriter;

    public static void main(String[] args) throws Exception {
        Instances data = loadData("data.txt");
           /* Changes in data */
        BufferedWriter writer = new BufferedWriter(new FileWriter("test.txt"));
        writer.write(data.toString());
        writer.flush();
        writer.close();
    }