为 Weka 创建一个 arff 文件

Creating an arff file for Weka

我正在创建一个 arff 文件并将其加载到 Weka 中,当我尝试 运行 J48 决策树时,我收到以下错误消息:

Can't have more folds than instances

下面是我目前得到的arff文件代码。

@relation correlation

@attribute Exercise {StarJumps, Swimming, Weightlift}
@attribute mean real
@attribute median real
@attribute mode real
@attribute variance real

@data
StarJumps,-35.1736999860234,-38.3397969100000,-78.7680334500000,1640.14992832077
StarJumps,12.8784175778633,11.2917098850000,-14.6784661500000,198.409868585395
StarJumps,-9.46453776621485,-4.66403639400000,-77.4871379300000,914.608427610169
Swimming,-22.0052249449766,-21.9835538100000,-61.8976363600000,184.991150374811
Swimming,27.4404695437188,31.7069603200000,-38.8908675200000,571.188153279291
Swimming,-23.0069047690899,-23.7253122400000,-65.0011242700000,312.565133535617
Weightlift,-29.9352298211914,-29.2759990400000,-77.3315111600000,739.673719008139
Weightlift,-2.73629441549609,-1.20216138950000,-42.4630638500000,208.415460430934
Weightlift,6.59529078057812,15.0662737500000,-77.0678713200000,982.853303465782

如有任何帮助,我们将不胜感激!

这是因为您使用的交叉验证折叠数高于使用 9 或更少的实例数 (9)。您还可以增加实例数。我建议将 Class 放在数据结构的末尾。查看: https://weka.wikispaces.com/ARFF+%28stable+version%29

干杯