- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我尝试在 R 中运行“genie3”算法(引用:http://homepages.inf.ed.ac.uk/vhuynht/software.html),它使用“randomForest”方法。
我遇到以下错误:
> weight.matrix<-get.weight.matrix(tmpLog2FC, input.idx=1:4551)
Starting RF computations with 1000 trees/target gene,
and 67 candidate input genes/tree node
Computing gene 1/11805
Show Traceback
Rerun with Debug
Error in randomForest.default(x, y, mtry = mtry, ntree = nb.trees, importance = TRUE, :
NA not permitted in predictors
所以我检查了我的数据中是否存在 NA,结果没有:
> NAs<-sapply(tmpLog2FC, function(x) sum(is.na(x)))
> length(which(NAs!=0))
[1] 0
然后,我尝试通过更改此行来编辑特定的“get.weight.matrix()”函数以省略 NA(以防万一):
rf <- randomForest(x, y, mtry=mtry, ntree=nb.trees, importance=TRUE, ...)
致:
rf <- randomForest(x, y, mtry=mtry, ntree=nb.trees, importance=TRUE, na.action=na.omit)
然后我获取了代码,并通过单独调用它(并显示实际脚本)来仔细检查它是否合并了更改:
}
target.gene.name <- gene.names[target.gene.idx]
# remove target gene from input genes
these.input.gene.names <- setdiff(input.gene.names, target.gene.name)
x <- expr.matrix[,these.input.gene.names]
y <- expr.matrix[,target.gene.name]
rf <- randomForest(x, y, mtry=mtry, ntree=nb.trees, importance=TRUE, na.action=na.omit)
但是,当尝试重新运行时,我收到相同的错误:
Error in randomForest.default(x, y, mtry = mtry, ntree = nb.trees, importance = TRUE, :
NA not permitted in predictors
有人遇到过类似的情况吗?关于我能做什么有什么想法吗?
提前致谢。
*编辑:按照建议,我重新运行调试:
> weight.matrix<-get.weight.matrix(tmpLog2FC, input.idx=1:4551)
Starting RF computations with 1000 trees/target gene,
and 67 candidate input genes/tree node
Computing gene 1/11805
Error in randomForest.default(x, y, mtry = mtry, ntree = nb.trees, importance = TRUE, :
NA not permitted in predictors
Called from: randomForest(x, y, mtry = mtry, ntree = nb.trees, importance = TRUE,
na.action = na.omit)
Browse[1]>
>
调试显示我怀疑的行引发了错误,但它以“na.action=na.omit”的编辑形式显示它。我更困惑了。没有 NA 的数据集,使用允许省略 NA 的代码运行,如何显示此错误?
最佳答案
您可以使用以下命令查找行列表,其中如果任何预测变量没有值,则会显示该行。
数据[!complete.cases(data),]
仔细检查行,就像在我的例子中,没有值的行",,,,,,,,,"(在我的文件中,列预测变量以逗号分隔)显示为 NA在 RF 运行时。
您可以删除该行。
谢谢
关于随机森林错误: NA not permitted in predictors (but no NAs in data),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23959810/
我是 Synology 的新手。我想要访问我的 Synology NAS 驱动器。我遵循 Synology_Download_Station_Official_API。 我阅读了基本工作示例以获取 A
我在两个联合的列中有 NA。在合并之前,我使用 str_to_title 来创建值的一致性。 问题是现在 NA 未注册为 NA,它们已合并为字符串。 IE。 City State
我有一个数据框,例如: Groups Event Value G1 1 Canidae G1 1 Canidae G1 1 Felidae G1
我想问一下,我有一个非公共(public)IP,位于NAT后面。我想从互联网访问我的家庭 Synology 服务器,但我无法使用 ssh 隧道。 是否有关于在 Synology NAS 服务器上安装
是否有人试图在 NAS 服务器上运行 PostgreSQL 服务器并挂载数据文件?您能否分享一下您是否遇到了一些性能问题或其他问题? 最佳答案 https://www.postgresql.org/d
我试图让我的 NAS 服务器在用户访问 NAS 时从 S3 sleep 状态唤醒。我想这样做是为了延长服务器的使用生命周期,同时限制其用电量。我见过有人寻求类似的建议,但我发现没有一个提供可靠的解决方
synology NAS 一:这步操作的前提是,你已经可以通过使用软件(Assistant)找到你网络中的NAS设备。接下来我们来安装DSM系统。 二:启动你的Assistant软件,点击搜索。
我正在运行以下代码: unique(is.na(mydataframe$var1)) #FALSE anyNA(mydataframe$var1) #FALSE mydataframe$var1
这个问题在这里已经有了答案: R `Inf` when it has class `Date` is printing `NA` (1 个回答) 3年前关闭。 我试图找出处理 Postgresql 表
我有一个包含用户信息的 data.frame,但每个用户 ID 可能有也可能没有重复的行,并且不同变量中存在相当多的缺失数据。我想做的是删除重复的用户数据,但对于每个用户,我想保留行中包含最少缺失值的
我正在尝试将存储卷安装到容器内。就像 linux 我给了下面的命令 **mount 10.#.##.###:/nvol1 /tmp** 这会产生“访问被拒绝”错误,我已将容器和主机 IP 添加到存储中
我想从大型数据框中删除“FALSE”和“NAs”。我的输入看起来像, 身份证代码1正确2不适用3错误4正确 我需要的输出是, 身份证代码1正确4正确 请建议在 R 中执行此操作的最佳方法谢谢 最佳答案
我正在尝试将文件压缩到Synology NAS(进入/ tmp目录)中。从我的Ubuntu计算机的命令行执行此操作可以按预期进行。运行PHP代码可以在常规Linux发行版上正常运行(就像我尝试过的每个
我试图找到一种简单的方法来计算数据框列中的非缺失案例。我已经使用了这个功能: foo<- function(x) { sum(!is.na(x)) } 然后通过 sapply() 将其应用到数据框 s
我想从大型数据框中删除“FALSE”和“NAs”。我的输入看起来像, 身份证代码1正确2不适用3错误4正确 我需要的输出是, 身份证代码1正确4正确 请建议在 R 中执行此操作的最佳方法谢谢 最佳答案
谁知道nas.sql表的这个字段的作用? ports int(5) server varchar(64) community varchar(50) 我认为社区用于 checkrad snmp 检查,
目前我的老板要求我的团队将我们的数据库迁移到云服务器(Windows)。除此之外,他还要求我们将 SAN/NAS 存储连接到该服务器,以获得更好的速度/性能。问题是我们没有SAN/NAS存储经验。 问
我是 swift 的新手,我试图找出如何从 NAS 服务器检索目录列表到我的应用程序中。 NAS 服务器、MAC 和 iPAD 在我的局域网中。 我确实搜索了那个问题,但找不到任何提示,而且我几天以来
我想编写一个服务器,从 NAS 读取文件并将其发送出去一个 socket 。最快的方法是什么? 谢谢! 最佳答案 我认为标准 CIFS 挂载支持文件上的 mmap(2)(如果我没看错,direct m
我想发送图片文件(jpg、png)到NAS server在java中使用smb 我添加了 jcifs-1.3.19.jar 。如前所述here和 here 编辑:我已经使用此代码成功将jpeg图像发送
我是一名优秀的程序员,十分优秀!