【问题标题】:OneR WEKA - wrong prediction?OneR WEKA - 错误的预测?
【发布时间】:2015-11-12 16:58:46
【问题描述】:

我正在尝试通过在 WEKA 中迭代使用 OneR,根据其预测能力对属性进行排名。每次运行时,我都会删除所选属性以查看下一个最佳属性。

我已经为我的所有属性都这样做了,并且一些(十分之三的属性)的“排名”比其他属性高,尽管它们的预测正确率较低,ROC 面积平均值较小,并且它们的规则不太紧凑。

据我了解,OneR 只查看它所具有的属性的频率表,然后查看类值,因此它不会关心我是否将属性取出......但我可能遗漏了一些东西

有人有想法吗?

【问题讨论】:

  • 为了加快速度,您可以使用“选择属性”菜单,然后使用 OneRAttributeEval 方法。结果可能会有所不同,具体取决于您选择“使用完整训练集”还是“交叉验证”。你使用了什么(大概是在分类菜单中),交叉验证还是完整的训练集?
  • 感谢您,我确实最终使用了 OneRAttributeEval - 然后结果就很好了。 :)

标签: classification weka


【解决方案1】:

作为替代方案,您可以使用 OneR 包(可在 CRAN 上获得,更多信息请点击此处:OneR - Establishing a New Baseline for Machine Learning Classification Models

使用选项verbose = TRUE,您可以获得所有属性的准确性,例如:

> library(OneR)
> example(OneR)

OneR> data <- optbin(iris)

OneR> model <- OneR(data, verbose = TRUE)

    Attribute    Accuracy
1 * Petal.Width  96%     
2   Petal.Length 95.33%  
3   Sepal.Length 74.67%  
4   Sepal.Width  55.33%  
---
Chosen attribute due to accuracy
and ties method (if applicable): '*'


OneR> summary(model)

Rules:
If Petal.Width = (0.0976,0.791] then Species = setosa
If Petal.Width = (0.791,1.63]   then Species = versicolor
If Petal.Width = (1.63,2.5]     then Species = virginica

Accuracy:
144 of 150 instances classified correctly (96%)

Contingency table:
            Petal.Width
Species      (0.0976,0.791] (0.791,1.63] (1.63,2.5] Sum
  setosa               * 50            0          0  50
  versicolor              0         * 48          2  50
  virginica               0            4       * 46  50
  Sum                    50           52         48 150
---
Maximum in each column: '*'

Pearson's Chi-squared test:
X-squared = 266.35, df = 4, p-value < 2.2e-16

(完全披露:我是这个包的作者,我会对你得到的结果非常感兴趣)

【讨论】:

    【解决方案2】:

    OneR 分类器看起来有点像最近邻。鉴于此,以下适用:在source code of the OneR classifier 中,它说:

        // if this attribute is the best so far, replace the rule
        if (noRule || r.m_correct > m_rule.m_correct) {
          m_rule = r;
        }
    

    因此,一个属性应该有可能(在1-R generally 或此实现中)阻止另一个属性,但稍后在您的进程中被删除。

    假设您有属性 1、2 和 3,分布为 1:50%、2:30%、3:20%。在属性 1 最好的所有情况下,属性 3 次之。

    因此,当属性 1 被排除在外时,属性 3 以 70% 的优势获胜,尽管之前属性 2 在三者的比较中排名“优于”3。

    【讨论】:

      猜你喜欢
      • 2018-01-28
      • 2017-12-07
      • 2015-04-13
      • 2019-08-30
      • 2017-01-09
      • 2017-04-30
      • 2012-10-19
      • 2016-05-22
      • 1970-01-01
      相关资源
      最近更新 更多