2014-12-13 41 views
0

當我試圖將CSV文件轉換爲ARFF時,出現以下錯誤消息。我該如何解決這個問題?在Java中如何隱藏csv文件到arff中?

---Registering Weka Editors--- 
    Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH? 
    Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH? 
    Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH? 
    Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH? 
    Exception in thread "main" java.lang.IllegalArgumentException: Attribute names are not unique! Causes: 'þÿÿÿ' 'á' '°' '=' '$' '$' '$' '$' '$' '$' '$' '$' '$' '$' '-' '$' '$' '$' '* ' '-' '-' 
     at weka.core.Instances.<init>(Instances.java:252) 
     at weka.core.converters.CSVLoader.readHeader(CSVLoader.java:979) 
     at weka.core.converters.CSVLoader.readStructure(CSVLoader.java:610) 
     at weka.core.converters.CSVLoader.getStructure(CSVLoader.java:595) 
     at weka.core.converters.CSVLoader.getDataSet(CSVLoader.java:628) 
     at ConvertToArff.Convert(ConvertToArff.java:22) 
     at ConvertToArff.main(ConvertToArff.java:35) 
+1

我不明白這個問題怎麼能得到兩個upvotes ... – Henry 2014-12-13 09:24:28

回答

0

根據您的例外情況,您的某個屬性具有多個同名的標籤。如果它們可以保持獨特性,那麼這個問題就不應該繼續下去。

如果這不是問題,請發佈更多的代碼和/或數據(這是非常難以診斷,只是一個例外)。

希望這有助於!