我在Weka中创建了一个决策树。我现在想要在matlab中计算预测(使用此模型)并在树中很好地可视化结果。但我无法找到一个很好的方法来绘制树和实例的结果。
我应该将其绘制为流程图吗?是否有开箱即用的方式来做到这一点?我可以在Matlab中计算C4.5并且它是否已经绘制了树?
答案 0 :(得分:0)
您可以直接从Weka可视化树:Visualizing Weka classification tree
然后,您可以要求Weka打印树,您可以在其他地方复制和解析结构。将结构视为某种嵌套的if / then / elses,将是这样的:
FeatureLabel-hasPRP <= 0
| FeatureAnimal-Class <= 0.636364
| | FeatureLabel-hasNNP <= 0
| | | v-subject-g-talk <= 0.285714
| | | | FeatureLabel-hasNN <= 0
| | | | | FeatureLabel-hasPOS <= 0
| | | | | | FeatureLabel-dep_head_det_the <= 0: NONACTOR (130.03/6.27)
| | | | | | FeatureLabel-dep_head_det_the > 0: ACTOR (16.19/6.27)
| | | | | FeatureLabel-hasPOS > 0: ACTOR (21.41/2.09)
| | | | FeatureLabel-hasNN > 0
| | | | | FeatureVehicle-Class <= 0.487179
...