weka中的arff文件

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}
@attribute temperature real
@attribute humidity real
@attribute windy {TRUE, FALSE}
@attribute play {yes, no}

@data
sunny,85,85,FALSE,no
sunny,80,90,TRUE,no
overcast,83,86,FALSE,yes
rainy,70,96,FALSE,yes
rainy,68,80,FALSE,yes
rainy,65,70,TRUE,no
overcast,64,65,TRUE,yes
sunny,72,95,FALSE,no
sunny,69,70,FALSE,yes
rainy,75,80,FALSE,yes
sunny,75,70,TRUE,yes
overcast,72,90,TRUE,yes
overcast,81,75,FALSE,yes
rainy,71,91,TRUE,no

arff格式文件的特點:a standard way of representing datasets that consist of independent,unordered instances and do not involve relationships among instances。各個記錄相互獨立、沒有順序要求,同時各個記錄間不存在關係。
called an ARFF file.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章