|
请教,为什么出现错误,百思不得 其解
Msg_data <- read.csv('C:/Users/shenning/Desktop/载重分析数据/平均载重xy.csv')
Msg_data <- Msg_data[1:50000,]
> Msg_data设备号<−as.factor(Msgdata设备号) #数据自变量7个,包括一个因子‘设备号’,因变量为’载重值‘
> 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.
|