.csv
100387C,254,73,93
100388D,2047,60,98
100388D,2736,62,9
100389E,951,82,90
100390F,2048,91,98
100411C,254,50,96
100412D,047,75,9
.arff
@relation test
@attribute Admno {100387C,100388.0,100389E,100390.0,100411C,100412.0}
@attribute Code {254,2047,2736,951,2048,254,047}
@attribute ore numeric
@attribute tend numeric
100387C,254,73,93
100388.0,2047,60,98
100388.0,2736,62,9
100389E,951,82,90
100390.0,2048,91,98
100411C,254,50,96
100412.0,047,75,9
如果您注意到转换后这两个数据之间存在差异 在@attribute Admno上从D到.0。我正在使用的文件转换如下。所以我想知道转换出了什么问题。感谢
CSVLoader loader = new CSVLoader();
loader.setSource(new File("C:\\test.csv"));
Instances data = loader.getDataSet();
ArffSaver saver = new ArffSaver();
saver.setInstances(data);
saver.setFile(new File("C:\\test.arff"));
saver.writeBatch();
答案 0 :(得分:0)