【问题标题】:Weka 3.8 - the decision tree J48 seem to have correct tree to predicate data but fail on the testingWeka 3.8 - 决策树 J48 似乎有正确的树来预测数据但在测试中失败
【发布时间】:2021-09-12 10:12:58
【问题描述】:

决策树 J48 生成的树结构如下。

J48 修剪树

petalwidth <= 0.6: Iris-setosa (50.0)
petalwidth > 0.6
|   petalwidth <= 1.7
|   |   petallength <= 4.9: Iris-versicolor (48.0/1.0)
|   |   petallength > 4.9
|   |   |   petalwidth <= 1.5: Iris-virginica (3.0)
|   |   |   petalwidth > 1.5: Iris-versicolor (3.0/1.0)
|   petalwidth > 1.7: Iris-virginica (46.0/1.0)

但它无法对下面的数据进行分类。有谁知道可能出了什么问题?

Plot : weka.classifiers.trees.J48 (iris)
Instance: 98
      sepallength : 5.0
       sepalwidth : 3.5
      petallength : 1.6
       petalwidth : 0.6
prediction margin : -1.0
  predicted class : Iris-versicolor
            class : Iris-setosa

【问题讨论】:

  • 你是否进行了 10 折交叉验证?如果是,那么您正在查看的模型基于完整的训练数据,而不是 CV 期间构建的 10 个模型之一。产生错误的绘图数据基于在评估期间从 10 个模型收集的预测。
  • @fracpete,谢谢你是对的。

标签: machine-learning artificial-intelligence weka decision-tree j48


【解决方案1】:

正如@fracpete 评论的那样,我正在使用交叉验证。 Weka 在分类器输出中显示的是经历完整训练集的分类器模型,而不是预测模型。

【讨论】:

    猜你喜欢
    • 2015-07-22
    • 2015-07-03
    • 2013-08-29
    • 2013-12-21
    • 2018-03-19
    • 2016-03-14
    • 2016-04-24
    • 2017-05-31
    • 2016-07-12
    相关资源
    最近更新 更多