首页 > 解决方案 > 当响应为多个数值时,如何处理stablelearner的函数stabletre?

问题描述

这是我适合树模型的代码:

paluTree.sub3.75 <- partykit::ctree(I(DensitePf^.25) + I(DensitePm^.25) ~ Age + sexe + Temperature + Moustiquaire + Objet_gites + PrvPalu + RetenuEau + IndVegetation,
                                    data = subset.df,
                                    minsplit = 75,
                                    minbucket = 75,
                                    maxdepth = 4)

我想使用stabletree()包的功能分析模型的稳定性stablelearner

diag.stabilite <- stablelearner::stabletree(paluTree.sub3.75,B = 100)

这不会产生错误,但是当我运行时,我会收到summary(diag.stabilite)以下错误消息

Error in round(sapply(nm, function(n) { : 
  non-numeric argument to mathematical function
also the following barplot(diag.stabilite) results in an error
Error in plot.window(xlim, ylim, log = log, ...) : 
  need finite 'xlim' values
In addition: Warning messages:
1: In min(w.l) : no non-missing arguments to min; returning Inf
2: In max(w.r) : no non-missing arguments to max; returning -Inf

标签: r

解决方案


推荐阅读