开发者

WEKA Unable to determine structure as arff

I am writing a script to do some classification using weka and I get an error when I try to run the classifier. I have converted the file from CSV using weka.core.converters.CSVLoader.

I have then removed some of the attributes from it using weka.filters.unsupervised.attribute.Remove -R 1,7,8

Now when I try to run the classifier on it using the command

java -classpath /home/jim/Downloads/weka-3-6-3/weka.jar weka.classifiers.trees.J48 -p 0 -split-percentage 66 -preserve-order -t arff_input/Config38-R.arff

I get an error saying

java.io.IOException: Unable to determine structure as arff (Reason: java.io.IOException: premature end of file, read Token[EOF], line 1).

EDIT - I presume this is an error in my first line so here it is.

@relation 'Config38-weka.filters.unsupervised.attribute.Remove-R1,开发者_如何学编程7,8'

Has anyone else encountered a similar problem? Or have I made a mistake some where.

Thanks


I changed the first line to

@relation Config38

and now it works. No idea why this works and the above didn't I'm afriad


If you delete the first line in .arff file it will also work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜