0
Python中的arff庫中的dump
命令使用戶能夠根據給定的輸入創建arff文件,例如,命令:由python中的arff庫創建的arff文件中的名義屬性
arff.dump("outputDir", data, relation="relation1",
names=['age, fatRatio, hairColor'])
產生以下ARFF:
@relation relation1
@attribute age real
@attribute hairColor string
@data
10,0.2,black
22,10,yellow
30,2,black
的數據給出:
data = [[10,0.2,'black'],[22,10,'yellow'],[30,2,'black']]
我的問題是:如何通知我想hairColor
到相關機制是一個名義上的屬性,即我希望我的阿爾菲標題如下:
@relation relation1
@attribute age real
@attribute hairColor **nominal**
@data
...