arff 文件格式 |
By wjliu182 發表於 2006-7-5 17:22:35 |
weka中分析對象是以arff格式文件表示的,主要有兩部分組成:文件頭和數據。文件頭包括relation說明和屬性說明。@relation weather @attribute temperature real @attribute windy {TRUE, FALSE} 屬性部分聲明屬性名稱和類別(如果爲枚舉型則說明預設數據值),數據部分由@data 引導。主要處理的數據類型有枚舉型(nominal)數值型(integer real)、文本型(string)、日期型(date)。從本質上來講只有nomianl 和numeric 兩類,因爲string 可看作特殊的nominal ,date則可以作爲numeric類型處理。date本身作爲String類型,當arff文件讀入時自動轉換爲date,其中每一部分(年月日等)可作爲整型處理。 weather表對應的arff文件如下: @relation weather @attribute outlook {sunny, overcast, rainy} @data arff格式文件的特點:a standard way of representing datasets that consist of independent,unordered instances and do not involve relationships among instances。各個記錄相互獨立、沒有順序要求,同時各個記錄間不存在關係。 |