0

Python の arff ライブラリのdumpコマンドを使用すると、次のコマンドのように、与えられた入力に従って 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、公称属性にしたいことを通知する方法、つまり、arff ヘッダーを次のようにしたいということです。

@relation relation1
@attribute age real
@attribute hairColor **nominal**
@data
...
4

1 に答える 1