0
在Weka中,如何從命令行顯示分類/決策樹?關於從命令行顯示分類/決策樹的方法?
在Weka中,如何從命令行顯示分類/決策樹?關於從命令行顯示分類/決策樹的方法?
我不確定您是否在尋找非常詳細的內容,但是當您使用weka.classifiers.trees時,基本上會打印決策樹。在response of mine中有隨機樹的插圖,但這裏是在虹膜數據集上使用J48
算法得到的結果:
~/weka/data$ weka weka.classifiers.trees.J48 -t iris.arff -i
J48 pruned tree
------------------
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)
Number of Leaves : 5
Size of the tree : 9
Time taken to build model: 0.08 seconds
Time taken to test model on training data: 0.01 seconds