randomForest:nrow(x)中的错误:参数;x";缺少,没有默认值
我想使用randomForest:nrow(x)中的错误:参数;x";缺少,没有默认值,r,random-forest,R,Random Forest,我想使用randomForest进行无监督分类。根据包装的技术规范,简单无监督包装的定义如下: set.seed(17) iris.urf <- randomForest(iris[, -5]) MDSplot(iris.urf, iris$Species) set.seed(17) iris.urf删除数据=,(即g=randomForest(dt))。?randomForest帮助建议您仅在使用公式时使用数据=notation@user20650:非常感谢。这很有帮助。@user20
randomForest
进行无监督分类。根据包装的技术规范,简单无监督包装的定义如下:
set.seed(17)
iris.urf <- randomForest(iris[, -5])
MDSplot(iris.urf, iris$Species)
set.seed(17)
iris.urf删除数据=
,(即g=randomForest(dt)
)。?randomForest
帮助建议您仅在使用公式时使用数据=
notation@user20650:非常感谢。这很有帮助。@user20650它对我来说也很奇怪,即使我使用的是公式符号!为什么不把它写成答案呢?请注意,即使您将data=和formula=参数命名为参数,公式也需要在randomForest函数中放在第一位才能工作。我知道这毫无意义,但我现在就是这样。
dt <- data.frame(currentData[,1:ncol(currentData)-1])
names(dt) <- paste0('X', 1:ncol(dt))
g = randomForest(data=dt)