不要自己做Arff文件,麻烦,你做成.csv,让weka自己另存为就行了。
文本文件打开,把字段名复制到第一段,保存成.csv
举个例子:
@RELATION cars
@ATTRIBUTE buying REAL
@ATTRIBUTE maint REAL
@ATTRIBUTE doors REAL
@ATTRIBUTE persons REAL
@ATTRIBUTE lug-boot REAL
@ATTRIBUTE safety REAL
@ATTRIBUTE class {unacc,acc,good,v-good}
@DATA
vhigh,vhigh,2,2,small,low,unacc
vhigh,vhigh,2,2,small,med,unacc
vhigh,vhigh,2,2,small,high,unacc
vhigh,vhigh,2,2,med,low,unacc
vhigh,vhigh,2,2,med,med,unacc
vhigh,vhigh,2,2,med,high,unacc
vhigh,vhigh,2,2,big,low,unacc
vhigh,vhigh,2,2,big,med,unacc
然后用Weka打开就可以了。