Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output weka results to text file

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.

like image 861
user4251864 Avatar asked Nov 14 '14 19:11

user4251864


2 Answers

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.

like image 58
webneko Avatar answered Sep 28 '22 15:09

webneko


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();
    }
like image 42
sheldonzy Avatar answered Sep 28 '22 14:09

sheldonzy