1. 程式人生 > >【解決】Weka匯入csv或arrf,報錯:nominal value not declared in header ,read token

【解決】Weka匯入csv或arrf,報錯:nominal value not declared in header ,read token

原因有幾種:(前2 種是老外給出的答案)

1、

you have some values occurring that are not exactly as declared in the header

2、

If you get this error message than you seem to have declared a nominal attribute in the ARFF header section, but Weka came across a value ("X") in the data (in line Y) for this particular attribute that wasn't listed as possible value. All

 nominal values that appear in the data must be declared in the header.

3、如果是中文,可能是識別問題。需要將RunWeka.ini中的【fileEncoding修改為中文支援的】舉例:

fileEncoding=Cp936

另外, 最好不要在資料 中出現以下字元

, = " ' *+ -%