我有一个使用c5.0算法的分类模型,脚本如下。pola = C5.0(train_set[,-8], train_set[,8])
然后,我使用此脚本显示决策树。plot(pola, type="s", main="Decision Tree")
帖子的结果给出了相互重叠的书写属性,如图所示。

那么,有没有一个库可以提供更好的树图片,或者是否有其他方法可以让我的树更容易阅读?谢谢你。
发布于 2020-06-13 15:34:41
问题看起来是“大小”,而不是一个糟糕的决策树图形。一种选择是将其保存为图像,然后在外部以更大的尺寸打开它。例如类似于:
png(file = 'mytree.png', width = 920, height = 1260)
plot(pola, type="s", main="Decision Tree")
dev.off()
# Open directory with image (credit to [this answer][1])
if (.Platform['OS.type'] == "windows"){
shell.exec(getwd())
} else {
system(paste(Sys.getenv("R_BROWSER"), getwd()))
}当然,这将使它成为这样,您可能必须滚动查看树的各个部分。
https://stackoverflow.com/questions/62355280
复制相似问题