解释朴素贝叶斯结果

发布于 2024-09-17 23:57:00 字数 723 浏览 4 评论 0原文

我开始使用 NaiveBayes/Simple 分类器进行分类(Weka),但是在训练数据时我有一些问题需要理解。我使用的数据集是weather.nominal.arff。

alt text

当我使用选项中的训练测试时,分类器结果是:

Correctly Classified Instances 13  -  92.8571 %    
Incorrectly Classified Instances 1 - 7.1429 %   

a b classified as  
9 0  a =yes
1 4  b = no

我的第一个问题是我应该从分类实例不正确?为什么会出现这样的问题呢?哪个属性集合分类错误?有没有办法理解这一点?

其次,当我尝试 10 倍交叉验证时,为什么我会得到不同(较少)正确分类的实例?

结果是:

Correctly Classified Instances           8               57.1429 %
Incorrectly Classified Instances         6               42.8571 %

 a b   <-- classified as
 7 2 | a = yes
 4 1 | b = no

I start using NaiveBayes/Simple classifier for classification (Weka), however I have some problems to understand while training the data. The data set I'm using is weather.nominal.arff.

alt text

While I use use training test from the options, the classifier result is:

Correctly Classified Instances 13  -  92.8571 %    
Incorrectly Classified Instances 1 - 7.1429 %   

a b classified as  
9 0  a =yes
1 4  b = no

My first question what should I understand from the incorrect classified instances? Why such a problem occurred? which attribute collection is classified incorrect? is there a way to understand this?

Secondly, when I try the 10 fold cross validation, why I get different (less) correctly classified instances?

The results are:

Correctly Classified Instances           8               57.1429 %
Incorrectly Classified Instances         6               42.8571 %

 a b   <-- classified as
 7 2 | a = yes
 4 1 | b = no

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

通知家属抬走 2024-09-24 23:57:00

您可以通过从以下位置选择此选项来获取每个实例的单独预测:

更多选项...>>输出预测>纯文本

除了评估指标之外,还会为您提供以下内容:

=== Predictions on training set ===

 inst#     actual  predicted error prediction
     1       2:no       2:no       0.704 
     2       2:no       2:no       0.847 
     3      1:yes      1:yes       0.737 
     4      1:yes      1:yes       0.554 
     5      1:yes      1:yes       0.867 
     6       2:no      1:yes   +   0.737 
     7      1:yes      1:yes       0.913 
     8       2:no       2:no       0.588 
     9      1:yes      1:yes       0.786 
    10      1:yes      1:yes       0.845 
    11      1:yes      1:yes       0.568 
    12      1:yes      1:yes       0.667 
    13      1:yes      1:yes       0.925 
    14       2:no       2:no       0.652 

表明第 6 个实例被错误分类。请注意,即使您在相同的实例上进行训练和测试,由于数据不一致,也可能会发生错误分类(最简单的示例是两个实例具有相同的特征但具有不同的类标签)。

请记住,上述测试方式是有偏见的(它有点作弊,因为它可以看到问题的答案)。因此,我们通常感兴趣的是对未见数据的模型误差进行更现实的估计。 交叉验证就是一种这样的技术,它将数据分为 10 个部分分层折叠,对其中一个折叠进行测试,同时对其他九个折叠进行训练,最后报告十次运行的平均准确度。

You can get the individual predictions for each instance by choosing this option from:

More Options... > Output predictions > PlainText

Which will give you in addition to the evaluation metrics, the following:

=== Predictions on training set ===

 inst#     actual  predicted error prediction
     1       2:no       2:no       0.704 
     2       2:no       2:no       0.847 
     3      1:yes      1:yes       0.737 
     4      1:yes      1:yes       0.554 
     5      1:yes      1:yes       0.867 
     6       2:no      1:yes   +   0.737 
     7      1:yes      1:yes       0.913 
     8       2:no       2:no       0.588 
     9      1:yes      1:yes       0.786 
    10      1:yes      1:yes       0.845 
    11      1:yes      1:yes       0.568 
    12      1:yes      1:yes       0.667 
    13      1:yes      1:yes       0.925 
    14       2:no       2:no       0.652 

which indicates that the 6th instances was misclassified. Note that even if you train and test on the same instances, misclassifications can occur due to inconsistencies in the data (the simplest example is having two instances with the same features but with different class label).

Keep in mind that the above way of testing is biased (its somewhat cheating since it can see the answers to the questions). Thus we are usually interested in getting a more realistic estimate of the model error on unseen data. Cross-validation is one such technique, where it partition the data into 10 stratified folds, performing the testing on one fold, while training on the other nine, finally it reports the average accuracy across the ten runs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文