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
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')
更多回答
我是一名优秀的程序员,十分优秀!