Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
randomForest:nrow(x)中的错误:参数;x";缺少,没有默认值_R_Random Forest - Fatal编程技术网

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)