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
...