问题
I've trained a classifier in Weka, and I'm able to use it on test data. Additionally, I can opt to display the classifier's predictions in the log window for this test data.
However, for my current project, it would be convenient for me to be able to get this data in CSV format. Is this possible in Weka ? Is it only possible when using the command line (something I'll eventually move towards) ?
I could always save the entire buffer result to a text file, but in that case, I would have to parse the file and remove all the "noise" (which isn't really noise, but you get the point).
So, to conclude, is there any way to output Weka's predictions for a test set to a CSV file ?
Edit: as the answer below shows, there is an option to do this. However, it can only be found in Weka 3.7 and above !
回答1:
I assume you use Weka's Explorer. In the Classify
tab click on More options...
, then click on Output predictions
and select CSV
. Now click on the box showing CSV
and a window opens where you can fill in the properties of writing to a CSV file. Click on outputFile
and select a folder and type a filename (note: you must supply a filename). Running a new test will now save the prediction results to your CSV file.
回答2:
In Weka 3.6.x you can right-click your model, choose "Visualize classifier errors" and Save the data (including the prediction) from there.
回答3:
If you use weka knowledge flow to build models (Easier than explorer), there are CSV data sinks you can use to save as CSV file.
来源:https://stackoverflow.com/questions/13130005/weka-predictions-to-csv