Export weka results on command line

2019-07-19 15:51发布

Is it possible to export weka results after execute it via command line?

What I am doing:

java -cp "./weka.jar" weka.classifiers.bayes.NaiveBayes -t "iris.arff" -i

But then, I have all the statistics in console, is there any way to export this? Or I have to read and write by myself?

Thanks!

1条回答
时光不老,我们不散
2楼-- · 2019-07-19 16:07

An example from the Weka Primer:

java -Xmx1024m weka.classifiers.trees.J48 -t data.arff -i -k -d J48-data.model >&! J48-data.out &

So no, WEKA doesn't have a specific output parameter on the command line, but you simply redirect the output and errors to a file using >&! or only the output without errors using >.

In your case you could use this command to save the output to the file NaiveBayes-iris.out:

java -cp "./weka.jar" weka.classifiers.bayes.NaiveBayes -t "iris.arff" -i > NaiveBayes-iris.out
查看更多
登录 后发表回答