3

当我观察到 RandomTree 配置中的 minNum 字段时,我正在玩 weka。我阅读了“叶子中实例的最小总重量”的描述。但是,我无法真正理解它的含义。

我玩弄了这个数字,我意识到当我增加它时,生成的树的大小会减小。我无法解释为什么会发生这种情况。

任何帮助/参考将不胜感激。

4

1 回答 1

3

这与叶节点上的最小实例数有关(在决策树中,默认情况下通常为 2,如 J48)。你设置的这个参数越高,树越通用,因为有很多叶子和少量实例会产生一个过于细化的树结构。

以下是iris数据集上的两个示例,显示了该-M选项可能如何影响结果树的大小:

$ weka weka.classifiers.trees.RandomTree -t iris.arff -i

petallength < 2.45 : Iris-setosa (50/0)
petallength >= 2.45
|   petalwidth < 1.75
|   |   petallength < 4.95
|   |   |   petalwidth < 1.65 : Iris-versicolor (47/0)
|   |   |   petalwidth >= 1.65 : Iris-virginica (1/0)
|   |   petallength >= 4.95
|   |   |   petalwidth < 1.55 : Iris-virginica (3/0)
|   |   |   petalwidth >= 1.55
|   |   |   |   sepallength < 6.95 : Iris-versicolor (2/0)
|   |   |   |   sepallength >= 6.95 : Iris-virginica (1/0)
|   petalwidth >= 1.75
|   |   petallength < 4.85
|   |   |   sepallength < 5.95 : Iris-versicolor (1/0)
|   |   |   sepallength >= 5.95 : Iris-virginica (2/0)
|   |   petallength >= 4.85 : Iris-virginica (43/0)

Size of the tree : 17

$ weka weka.classifiers.trees.RandomTree -M 6 -t iris.arff -i

petallength < 2.45 : Iris-setosa (50/0)
petallength >= 2.45
|   petalwidth < 1.75
|   |   petallength < 4.95
|   |   |   petalwidth < 1.65 : Iris-versicolor (47/0)
|   |   |   petalwidth >= 1.65 : Iris-virginica (1/0)
|   |   petallength >= 4.95 : Iris-virginica (6/2)
|   petalwidth >= 1.75
|   |   petallength < 4.85 : Iris-virginica (3/1)
|   |   petallength >= 4.85 : Iris-virginica (43/0)

Size of the tree : 11

作为旁注,随机树依赖于 bagging,这意味着有一个属性的子采样(K 随机选择在每个节点处拆分);然而,与 REPTree 不同的是,没有修剪(就像在 RandomForest 中一样),因此您最终可能会得到非常嘈杂的树。

于 2011-05-18T10:08:35.320 回答