OneR WEKA - 错误预测?

时间:2015-08-19 11:51:23

标签: classification weka

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

我已经为我的所有属性做了这个,有些(十分之三的属性)得到排名'虽然它们的正确预测百分比较低,但ROC面积平均值较小且规则较不紧凑。

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

有人有想法吗?

2 个答案:

答案 0 :(得分:0)

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。

答案 1 :(得分:0)

作为替代方案,您可以使用OneR软件包(可在CRAN上获得,更多信息请访问:http://vonjd.github.io/OneR

使用选项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

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