懷卡托(weka)智能分析環境_作業教學_成功把網路上資料放進weka_逐步Debug

weka是紐西蘭的一種鳥名
又被稱作毛利母雞一種體型為一隻雞大小、不能飛的鳥類


看起來不錯吃



這裡在課堂中是指

由紐西蘭懷卡托大學用Java開發的數據挖掘常用軟體

 



WEKA存儲數據的格式是ARFF(Attribute-Relation File Format)文件,

一種ASCII文本文件。


第一階段. 觀察檔案內容格式

下載好weka3.8軟體後

到 C:\Program Files\Weka-3-8\data
(PS:於WEKA安裝目錄的「data」子目錄下尋找)

開啟一個關於天氣預報的檔案內容描述  weather.numeric.arff



這裡推薦用  Ultraedit(要付費,免費有有效期限)

或是 Notepad++(免費無期限) 開啟

識別ARFF文件的重要依據是分行,因此不能在這種文件里隨意的斷行
也盡量不要用 文字記事本打開怕會受到因為回車符定義不一致而導致分行不正常
(换行符'\n'  以及  回車符'\r')


ARFF files have two distinct sections.

The first section is the Header information, which is followed the Data information.

The Header of the ARFF file contains

(1). the name of the relation,
(2). a list of the attributes (the columns in the data), and their types.






the nth @attribute declaration is always the nth field of the attribute
當你有 N個  @attribute  宣告的時候  就代表你 有 N個屬性欄位












第二階段. 自行網搜資料庫

http://data.gov.tw/



--> 全部資料集

課堂的小提醒

(1)資料不吃  中文

(2)excel的檔案轉成 ARFF 格式

(3)盡量是  numeric 的 型態

(4)檢查是否會把最後一行判斷成類別



這裡挑選了  新竹市市有財產總值


Step1.將 Excel 的中文字轉英文




http://ikuz.eu/csv2arff/

透過線上轉檔


第一次跟第二次都出現錯誤











第三次我修改成







http://stackoverflow.com/questions/27130047/unable-to-determine-structure-as-arff



還是失敗

第五次修改


還是失敗

第六次修改



這次出現新的錯誤原本第一航一直出錯
終於解決

我這次把第十行去除

就成功餵進weka了


新竹市市有財產總值
放入  weka 分析的結果顯示

成功解決問題

注意最一開始 問題主要是第一個有空白的問題

後來測試   REAL  不改  numeric 也可以放進 weka


http://stackoverflow.com/questions/27130047/unable-to-determine-structure-as-arff

http://www.cs.waikato.ac.nz/ml/weka/arff.html

http://weka.8497.n7.nabble.com/RE-weka-load-error-unable-to-determine-structure-as-arff-reason-java-ioexception-keyword-relation-ex-td26310.html

http://stackoverflow.com/questions/38244254/unable-to-determine-structure-as-arff-when-using-utf-8-arff-file-in-weka


留言

這個網誌中的熱門文章

經得起原始碼資安弱點掃描的程式設計習慣培養(五)_Missing HSTS Header

經得起原始碼資安弱點掃描的程式設計習慣培養(三)_7.Cross Site Scripting(XSS)_Stored XSS_Reflected XSS All Clients

(2021年度)駕訓學科筆試準備題庫歸納分析_法規是非題