0

我正在尝试找出 WEKA 并使用我拥有的数据进行一些实验。

基本上我想要做的是获取数据集 1,将其用作训练集。在其上运行 J48 决策树。然后获取数据集 2 并在其上运行经过训练的树,原始数据集的输出带有一个额外的列,用于预测是什么。

然后用贝叶斯神经网络再次做同样的事情。

有人可以指出我将如何完成此操作的详细说明链接吗?我似乎遗漏了一些步骤,无法通过额外的列获得原始数据集的输出。

4

1 回答 1

1

这是使用命令行执行此操作的一种方法。此信息可在软件随附的 Weka 手册的第 1 章(“命令行入门”)中找到。

java weka.classifiers.trees.J48 -t training_data.arff -T test_data.arff -p 1-N

在哪里:

-t <training_data.arff> specifies the training data in ARFF format
-T <test_data.arff> specifies the test data in ARFF format
-p 1-N specifies that you want to output the feature vector and the prediction,
     where N is the number of features in your feature vector.

例如,这里我使用 soy.arff 进行训练和测试。特征向量中有35个特征:

java weka.classifiers.trees.J48 -t 大豆.arff -T 大豆.arff -p 1-35

输出的前几行如下所示:

=== Predictions on test data ===

 inst#     actual  predicted error prediction (date,plant-stand,precip,temp,hail,crop-hist,area-damaged,severity,seed-tmt,germination,plant-growth,leaves,leafspots-halo,leafspots-marg,leafspot-size,leaf-shread,leaf-malf,leaf-mild,stem,lodging,stem-cankers,canker-lesion,fruiting-bodies,external-decay,mycelium,int-discolor,sclerotia,fruit-pods,fruit-spots,seed,mold-growth,seed-discolor,seed-size,shriveling,roots)
     1 1:diaporth 1:diaporth       0.952 (october,normal,gt-norm,norm,yes,same-lst-yr,low-areas,pot-severe,none,90-100,abnorm,abnorm,absent,dna,dna,absent,absent,absent,abnorm,no,above-sec-nde,brown,present,firm-and-dry,absent,none,absent,norm,dna,norm,absent,absent,norm,absent,norm)
     2 1:diaporth 1:diaporth       0.952 (august,normal,gt-norm,norm,yes,same-lst-two-yrs,scattered,severe,fungicide,80-89,abnorm,abnorm,absent,dna,dna,absent,absent,absent,abnorm,yes,above-sec-nde,brown,present,firm-and-dry,absent,none,absent,norm,dna,norm,absent,absent,norm,absent,norm)

列是:(1)数据实例编号;(2) 真实标签;(3) 预测标签;(4) 错误;(5) 预测置信度;(6) 特征向量。

于 2013-06-28T21:10:40.673 回答