gpt4 book ai didi

How to resolve error "package ‘treeshap’ is not available for this version of R"? [duplicate](如何解决错误“包‘treeshap’不适用于此版本的R”?[副本])

转载 作者:bug小助手 更新时间:2023-10-22 13:51:01 28 4
gpt4 key购买 nike




if I try to run the treeshap function I get the following error

如果我尝试运行treeshap函数,我会得到以下错误


> TreeShapVal = treeshap(xgboost.unify(modelXG, x), x, interactions = FALSE, verbose = TRUE)
Error in treeshap(xgboost.unify(modelXG, x), x, interactions = FALSE, :
could not find function "treeshap"

If I try to install the treeshap package then I get the following errors

如果我尝试安装treeshap包,则会出现以下错误


> library(treeshap)
Error in library(treeshap) : there is no package called ‘treeshap’
> install.packages("treeshap")
Installing package into ‘C:/Users/BootMR/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘treeshap’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

I am using RStudio 2023.06. I downloaded and installed RTools last week. I have no idea how to resolve and get the treeshap package to work?

我使用的是RStudio 2023.06。我上周下载并安装了RTools。我不知道如何解决并使树形包工作?


更多回答

which R version are you running? (this is a separate question to which Rstudio version)?

您正在运行哪个R版本?(这是Rstudio版本的另一个问题)?

Actually having just looked, there is no package on CRAN called treeshap, either current or in the archive. You will need to install from the github for the package.

事实上,刚刚看了看,CRAN上没有一个名为treeshap的包,无论是当前的还是存档中的。您需要从github安装该软件包。

Try: devtools::install_github('ModelOriented/treeshap')

尝试:devtools::install_github('ModelOriented/treeshap')

Thanks for your answers! it's R version 4.3.0

谢谢你的回答!它是R版本4.3.0

For "could not find function", see stackoverflow.com/q/7027288/3358272. For "there is no package", see stackoverflow.com/q/66741120/3358272, stackoverflow.com/q/47395807/3358272. This is a duplicate of some or all of that.

有关“找不到函数”的信息,请访问stackoverflow.com/q/702728/3358272。关于“没有包裹”,请参阅stackoverflow.com/q/66741120/3358272、stackoverlow.com/q/47395807/3358272。这是部分或全部的复制品。

优秀答案推荐

There is no package on CRAN called treeshap, either current or in the archive. You will need to install from the github for the package. –

CRAN上没有名为treeshap的包,无论是当前的还是存档中的。您需要从github安装该软件包。–


devtools::install_github('ModelOriented/treeshap')

更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com