R中的方包中的ctree图决策树,终端节点出现一些奇怪的数字-问题? [英] ctree plot decision tree in party package in R , terminal node occurs some weird numbers - issue?

查看:379
本文介绍了R中的方包中的ctree图决策树,终端节点出现一些奇怪的数字-问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我碰到了一件很奇怪的事情..我不知道为什么.

I came across something really odd.. and I couldn't figured it out why..

我在下面使用相同的代码:

I use the same code here below :

library(party)
r_tree <- ctree(readingSkills$nativeSpeaker ~ readingSkills$age + 
                 readingSkills$shoeSize + readingSkills$shoeSize + 
                 readingSkills$score,data = readingSkills)
plot(r_tree,type = "simple")
r_tree

两个星期前,我得到了正常图..但是今天我的终端节点中有些奇数,如下图所示..我试图重新启动PC,卸载数据包,一次又一次地重新安装,但是还是行不通.. 只是想知道是否有人看到相同的问题,或者我做错了什么,或者我该如何解决?

two week ago I got normal graph .. but today my terminal nodes have some odd numbers in them like showing in this picture below.. I have tried to restarted my PC , uninstalled the packet , reinstall again and again , but it still not working.. Just wondering if anyone see the same issue , or what have I done wrong , or how can I fix this ?

谢谢

推荐答案

这是由"partykit"软件包引起的错误.如果您要从头开始重新打开R或执行以下操作:

This is a bug caused by package "partykit". If you'll reopen R from start or do:

detach("package:partykit", unload=TRUE)并运行

library(party)
r_tree <- ctree(readingSkills$nativeSpeaker ~ readingSkills$age + 
                  readingSkills$shoeSize + readingSkills$shoeSize + 
                  readingSkills$score,data = readingSkills)
plot(r_tree,type = "simple")

您将得到正常的情节

You'll get the normal plot

但是,如果您再次存储"partykit"软件包并重新运行相同的代码,则将再次得到该废话.

But if you'll library the "partykit" package again and rerun the same code, you''ll get that nonsense plot again

library(partykit)
r_tree <- ctree(readingSkills$nativeSpeaker ~ readingSkills$age + 
                  readingSkills$shoeSize + readingSkills$shoeSize + 
                  readingSkills$score,data = readingSkills)
plot(r_tree,type = "simple")

这篇关于R中的方包中的ctree图决策树,终端节点出现一些奇怪的数字-问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆