Cela a à voir avec le nombre minimum d'instances sur un nœud feuille (qui est souvent 2 par défaut dans les arbres de décision, comme J48). Plus vous définissez ce paramètre, plus l'arborescence sera générale car avoir beaucoup de feuilles avec un faible nombre d'instances donne une structure arborescente trop granulaire.
Voici deux exemples sur l'ensemble de données iris
, qui montre comment l'option -M
pourrait affecter la taille de l'arbre résultant:
$ 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
En sidenote, les arbres au hasard comptent sur ensachage, ce qui signifie qu'il ya un sous-échantillonnage de les attributs (K choisis au hasard pour se séparer à chaque nœud); Contrairement à REPTree, cependant, il n'y a pas d'élagage (comme dans RandomForest), donc vous pouvez vous retrouver avec des arbres très bruyants.