关于在Weka中研究样品的初学者问题 [英] beginner question on investigating on samples in Weka

查看:75
本文介绍了关于在Weka中研究样品的初学者问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用Weka在分类标签下训练了我的SVM分类器。
现在,我想进一步调查哪些数据样本被错误分类了,我需要研究它们的模式,但是我不知道从Weka那里可以看到什么。
有人可以给我些帮助吗?
预先感谢。

I've just used Weka to train my SVM classifier under "Classify" tag. Now I want to further investigate which data samples are mis-classified,I need to study their pattern,but I don't know where to look at this from Weka. Could anyone give me some help please? Thanks in advance.

推荐答案

您可以从以下位置启用该选项:

You can enable the option from:

您将得到以下实例预测:

You will get the following instance predictions:

=== Predictions on test split ===

 inst#     actual   predicted  error prediction
   1   2:Iris-ver  2:Iris-ver         0.667 
  ...
  16   3:Iris-vir  2:Iris-ver   +     0.667 






编辑

正如我在评论中解释的那样,您可以使用 StratifiedRemoveFolds 过滤器手动拆分数据并创建10倍的交叉验证。

As I explained in the comments, you can use the StratifiedRemoveFolds filter to manually split the data and create the 10-folds of the cross-validation.

来自Weka Wiki的 Primer 如何从命令行调用Weka的一些示例。以下是一个示例bash脚本:

This Primer from the Weka wiki has some examples of how to invoke Weka from the command line. Here's a sample bash script:

#!/bin/bash

# I assume weka.jar is on the CLASSPATH

# 10-folds CV
for f in $(seq 1 10); do
    echo -n "."

    # create train/test set for fold=f
    java weka.filters.supervised.instance.StratifiedRemoveFolds -i iris.arff \
        -o iris-f$f-train.arff -c last -N 10 -F $f -V
    java weka.filters.supervised.instance.StratifiedRemoveFolds -i iris.arff \
        -o iris-f$f-test.arff -c last -N 10 -F $f

    # classify using SVM and store predictions of test set
    java weka.classifiers.functions.SMO -C 1.0 \
        -K "weka.classifiers.functions.supportVector.RBFKernel -G 0.01" \
        -t iris-f$f-train.arff -T iris-f$f-test.arff \
        -p 0 > f$f-pred.txt
        #-i > f$f-perf.txt
done
echo

这将创建两个数据集(训练/测试),并将预测结果也存储在文本文件中。这样,您就可以将每个索引与测试集中的实际实例进行匹配。

For each fold, this will create two datasets (train/test) and store the predictions in a text file as well. That way you can match each index with the actual instance in the test set.

当然,如果您愿意,也可以在GUI中进行相同的操作(仅此一点而已!)

Of course the same can be done in the GUI if you prefer (only a bit more tedious!)

这篇关于关于在Weka中研究样品的初学者问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆