3896 6

[问答] R运行随机森林,rfimpute报错,百思不得其解,在线等大神 [推广有奖]

  • 0关注
  • 0粉丝

已卖:1份资源

大专生

61%

还不是VIP/贵宾

-

威望
0
论坛币
95 个
通用积分
2.0487
学术水平
0 点
热心指数
2 点
信用等级
0 点
经验
625 点
帖子
54
精华
0
在线时间
41 小时
注册时间
2016-3-5
最后登录
2019-2-18

楼主
鱼铃五校名2 发表于 2017-11-13 15:41:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Msg_data <- read.csv('C:/Users/shenning/Desktop/载重分析数据/平均载重xy.csv')
Msg_data <- Msg_data[1:50000,]
> Msg_data$设备号 <- as.factor(Msg_data$设备号)
> set.seed(1)
> ind <- sample(2,nrow(Msg_data),replace=T,prob=c(0.7,0.3))
> train<-Msg_data[ind==1,]
> test<- Msg_data[ind==2,]
> train<- rfImpute(载重值~., data=train)
Error in randomForest.default(xf, y, ntree = ntree, ..., do.trace = ntree,  :
Can not handle categorical predictors with more than 53 categories.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:百思不得其解 随机森林 put 在线等 Train

沙发
鱼铃五校名2 发表于 2017-11-13 15:51:26
#数据自变量7个,包括一个因子‘设备号’,因变量为’载重值‘

藤椅
鱼铃五校名2 发表于 2017-11-13 16:02:28
大神们,帮忙解答下吧

板凳
jgchen1966 发表于 2017-11-14 17:33:30
“Can not handle categorical predictors with more than 53 categories.”:告知,因子变量的因子水平数太多太多了,randomForest 无法处理!!!!!!!!!!!!!!

报纸
鱼铃五校名2 发表于 2017-11-15 15:35:23
jgchen1966 发表于 2017-11-14 17:33
“Can not handle categorical predictors with more than 53 categories.”:告知,因子变量的因子水平数太 ...
可是我删掉变量只剩三个的时候也提示这个,怎么办?

地板
小五sunny 发表于 2017-11-16 05:24:07 来自手机
鱼铃五校名2 发表于 2017-11-13 15:41
Msg_data  ind  train test train
从结果来看,是某个变量的类别数超过了53个,是不是设备号?设备号有几类?

7
鱼铃五校名2 发表于 2017-11-16 11:14:41
知道哪里出错了,就是设备号的问题。感谢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 22:33