[英]Labels are blank in Decision Tree plot in r
You need 你需要
plot(carMod$finalModel)
text(carMod$finalModel)
Use the following code, as explained on the help page for plot.rpart
( https://stat.ethz.ch/R-manual/R-devel/library/rpart/html/plot.rpart.html ): 使用以下代码,如对plot.rpart
( https://stat.ethz.ch/R-manual/R-devel/library/rpart/html/plot.rpart.html )的帮助页面plot.rpart
:
plot(carMod$finalModel)
text(carMod$finalModel)
Alternatively use 替代使用
library(rpart.plot)
rpart.plot(carMod$finalModel)
For more information, see https://blog.revolutionanalytics.com/2013/06/plotting-classification-and-regression-trees-with-plotrpart.html 有关更多信息,请参阅https://blog.revolutionanalytics.com/2013/06/plotting-classification-and-regression-trees-with-plotrpart.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.