4
我刚刚开始使用Weka并遇到了第一步的麻烦。分步指南为Weka中的异或情况训练多层感知器?
我们已经得到了我们的训练集:
@relation PerceptronXOR @attribute X1 numeric @attribute X2 numeric @attribute Output numeric @data 1,1,-1 -1,1,1 1,-1,1 -1,-1,-1
第一步我想要做的只是训练,然后进行分类使用Weka的GUI一套。 我到目前为止所做的一切:
使用Weka 3.7.0。
- 启动GUI。
- 资源管理器。
- 打开文件 - >选择我的arff文件。
- 分类选项卡。
- 使用训练集单选按钮。
- 选择 - >功能>多层感知器
- 单击顶部的'多层感知器'文本打开设置。
- 将隐藏层设置为'2'。 (如果gui选择正确,则表明这是我们想要的正确网络)。点击确定。
- 点击开始。
输出:
=== Run information === Scheme: weka.classifiers.functions.MultilayerPerceptron -L 0.3 -M 0.2 -N 500 -V 0 -S 0 -E 20 -H 2 -R Relation: PerceptronXOR Instances: 4 Attributes: 3 X1 X2 Output Test mode: evaluate on training data === Classifier model (full training set) === Linear Node 0 Inputs Weights Threshold 0.21069691964232443 Node 1 1.8781169869419072 Node 2 -1.8403146612166397 Sigmoid Node 1 Inputs Weights Threshold -3.7331156814378685 Attrib X1 3.6380519730323164 Attrib X2 -1.0420815868133226 Sigmoid Node 2 Inputs Weights Threshold -3.64785119182632 Attrib X1 3.603244645539393 Attrib X2 0.9535137571446323 Class Input Node 0 Time taken to build model: 0 seconds === Evaluation on training set === === Summary === Correlation coefficient 0.7047 Mean absolute error 0.6073 Root mean squared error 0.7468 Relative absolute error 60.7288 % Root relative squared error 74.6842 % Total Number of Instances 4
这似乎很奇怪,在0.3 500次迭代没有得到它的错误,但5000 @ 0.1呢,所以让我们一起去那。
现在使用的测试数据集:
@relation PerceptronXOR @attribute X1 numeric @attribute X2 numeric @attribute Output numeric @data 1,1,-1 -1,1,1 1,-1,1 -1,-1,-1 0.5,0.5,-1 -0.5,0.5,1 0.5,-0.5,1 -0.5,-0.5,-1
- 单选按钮,以 '提供的测试集'
- 选择我的测试集ARFF。
- 点击开始。
=== Run information === Scheme: weka.classifiers.functions.MultilayerPerceptron -L 0.1 -M 0.2 -N 5000 -V 0 -S 0 -E 20 -H 2 -R Relation: PerceptronXOR Instances: 4 Attributes: 3 X1 X2 Output Test mode: user supplied test set: size unknown (reading incrementally) === Classifier model (full training set) === Linear Node 0 Inputs Weights Threshold -1.2208619057226187 Node 1 3.1172079341507497 Node 2 -3.212484459911485 Sigmoid Node 1 Inputs Weights Threshold 1.091378074639599 Attrib X1 1.8621040828953983 Attrib X2 1.800744048145267 Sigmoid Node 2 Inputs Weights Threshold -3.372580743113282 Attrib X1 2.9207154176666386 Attrib X2 2.576791630598144 Class Input Node 0 Time taken to build model: 0.04 seconds === Evaluation on test set === === Summary === Correlation coefficient 0.8296 Mean absolute error 0.3006 Root mean squared error 0.6344 Relative absolute error 30.0592 % Root relative squared error 63.4377 % Total Number of Instances 8
为什么无法将这些正确分类?
仅仅因为它在训练数据上很快达到当地最低标准,并且不知道那不适合所有情况?
问题。
- 为什么500 @ 0.3不起作用?对于这样一个简单的问题似乎很奇怪。
- 为什么它在测试集上失败。
- 我该如何传入一组来分类?
1.如果学习率太高,它不会收敛。即使0.1有点大。 –