- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
xgb.fi()
是一个与 xgboost 配合使用以检测变量之间的相互作用的新函数。
文档可在此处找到:https://rdrr.io/github/RSimran/RXGBfi/man/xgb.fi.html
这是一个重要的主题,我尝试测试该功能但遇到异常。
请参阅下面的可重现示例:
library(data.table)
library(xgboost)
library(RXGBfi)
data(mtcars)
X = as.matrix(mtcars[, -9])
Y = mtcars$am
dtrain = xgb.DMatrix(data = X, label = Y)
model = xgb.train(data = dtrain,
eval = "auc",
verbose =0, maximize = TRUE,
params = list(objective = "binary:logistic",
eta = 0.1,
max_depth = 6,
subsample = 0.8,
lambda = 0.1 ),
nrounds = 10)
features = names(mtcars)[-9]
xgb.fi(model = model, features = features)
Listening on http://127.0.0.1:7333
Warning: Error in :=: Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are defined for use in j, once only and in particular ways. See help(":=").
Stack trace (innermost first):
95: :=
94: [.data.frame
93: [.data.table
92: [
91: tableVars1
90: base::rownames
89: datatable
88: eval
87: eval
86: %>%
85: exprFunc
84: widgetFunc
83: func
82: origRenderFunc
81: renderFunc
80: origRenderFunc
79: output$tableVars1
4: <Anonymous>
3: do.call
2: print.shiny.appobj
1: <Promise>
最佳答案
当我测试你的代码时,我得到了和你一样的错误。所以我决定深入研究函数 xgb.fi(),我将源代码复制到这里:https://github.com/RSimran/RXGBfi/blob/master/R/xgbfi.R并逐行执行它以识别我们在 Shiny 的应用程序中看到的错误。
当我这样做时,它工作正常......所以我执行了整个函数以重写函数 xgb.fi() (它出现在我的 Rstudio 环境中),然后我再次运行代码。这一次, Shiny 效果完美。
[your code, with the xgboost model]
xgb.fi <- function(model, xgbfi.loc = "C:/xgbfi", features = NULL, max.interaction.depth = 2,
max.deepening = -1, max.trees = -1, top.k = 100, max.histograms = 10) {
library(xgboost)
xgbfi_exe <- paste0(xgbfi.loc, "/", "bin", "/", "XgbFeatureInteractions.exe")
featureVector <- c()
[...]
}
xgb.fi(model = model, features = features)
这样,第一个表“3 Variable Feature”上只有一个错误,因为在您的示例中,模型没有创建与 3 个变量的交互。
关于r - xgb.fi() 函数检测交互并使用 xgboost 返回异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49686063/
除了智能手机、平板电脑和个人电脑等流行设备外,Wi-Fi 6还将嵌入其他设备中,包括无线摄像头、智能家居设备、游戏机、可穿戴设备和AR/VR耳机。 那么,Wi-Fi 6会取代5G,成为下一代无线网络
在 API 14 或更高版本 (ICS) 中,可以使用临时 Wi-Fi 网络。我目前拥有以下设备,我正在尝试弄清楚如何测试 Wi-Fi 直连功能,或者我是否需要购买另一台搭载 Android 4.0
我正在构建一个 Android 应用程序以允许在有限范围内的两个设备之间进行通信,但我找不到与 native 等效的插件 Android Wi-Fi peer-to-peer适用于 Phonegap/
我目前正在尝试通过 Wi-Fi Direct 连接两部知道彼此 MAC 地址的手机,但偶然发现了以下问题:我从 收到的 MAC 地址 WifiManager wifiMan = (WifiMa
在 iOS 设备内和支持 Wi-Fi Direct 的设备之间是否可以进行 Wi-Fi Direct 连接? 目标是在没有任何 Controller 的情况下实现 iOS 设备与另一台设备(不一定是另
我正在开发一个管理 Wi-Fi 连接的应用程序。我的场景如下:假设整栋楼都有一个名为“testing-tls”的 Wi-Fi 网络。我的应用程序应该只能连接到选定的接入点(基于 BSSID 或 MAC
我正在尝试编译这段代码,但出现以下错误: Q2.sh: line 18: syntax error near unexpected token `fi' Q2.sh: line 18: `fi' 在第
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
看到这个脚本,我试图弄清楚使用的是什么语言......它几乎就像 C 但我注意到 fi 作为关闭嵌套 if 的一种方式。 function prompt () { if [ "$noprompt" ]
我们正在使用专用网络,其中端口被防火墙阻止。 我们将提出为我们的机器IP地址打开端口的请求。 如果启用了wi-fi,则系统将具有2个IP地址,并且如果我们的连接通过该IP地址进行路由,则我们将无法访问
根据这篇文章:peer-to-peer Wi-Fi,我知道对等在iOS设备之间采用Bonjour连接。但是,我无法使它在专属网络中的设备(例如星巴克或Panera Bread)之间工作。 如果您能够在
我正在尝试编写一个脚本来删除所有以奇数结尾的 .jpg。这是我的代码: #!/bin/bash echo "start\n" for f in *.jpg do fname=$(basename
我一直在到处寻找解释。这是取自 apt-fast.sh 脚本的真实示例: if [ ! -x /usr/bin/axel ] then echo "axel is not installed, per
我正在 GCM (Android) 上开发示例应用程序。在其中我使用 tomcat 服务器发送消息。以及接收消息的设备。一切正常,除非我的 wifi 关闭。一旦我的 wi-fi 关闭,我就停止向我的设
我有一个带有以下内容的 mySQL 数据库 e.g.Microeconomics. The ‘theory of the ï¬rm’ or:Resource allocation modiï¬cati
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
这个问题在这里已经有了答案: Associating my Windows computer to a wifi AP with Python (3 个答案) 关闭 9 年前。 想象一下,您有 Wi
今天,我想测量 Wi-Fi 信号质量。所以我下载了Wi-Fi Analyzer app,然后安装到模拟器上,但是显示没有打开Wi-Fi。因此我打开它,但它仍然显示错误。 试了几次还是不行 有什么想法吗
频谱类型 传统上讲,蜂窝网络工作于授权频谱,Wi-Fi工作于非授权频谱。但进入5G时代,这种划分逐渐变得模糊。一方面,一些国家,比如德国、英国、日本、法国、美国等,已经为5G专网分配了本地化频
前边总得说点什么 最近每次在Win10上写代码需要启动Redis,残血Redis For Windows有卡死系统的bug。由于主机内存不大够用(已经扩到顶了),开虚拟机运行Redis更别提了。。想起
我是一名优秀的程序员,十分优秀!