如果(n == 0)stop(“数据(x)有0行”),R中的tuneRF出错:参数的长度为零

时间:2018-11-25 19:11:27

标签: r random-forest ctree finetunning

我想优化 let node = SCNNode() //I Configure node here node.eulerAngles.x = -.pi / 2 node.geometry = plane let cameraTransform = sceneView.session.currentFrame!.camera.transform var translation = matrix_identity_float4x4 notifNode.simdTransform = matrix_multiply(cameraTransform, translation) animate(notifNode) //This moves the node to position (0,0,0) ctree())的超参数的值。 我使用功能randomforest。我收到以下错误:

tuneRF

这是我的代码:

Error in if (n == 0) stop("data (x) has 0 rows") : 
  argument is of length zero

这是我寻找library(party) library(randomForest) library(mlbench) dat1 <- fread('https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data',stringsAsFactors=T) ## split data to train and test set.seed(123) dat1 <- subset(dat1, !is.na(V1)) smp_size =92 train_ind <- sample(seq_len(nrow(dat1)), size = smp_size) train <- dat1[train_ind, ] test <- dat1[-train_ind, ] ct <- ctree(V1 ~ ., data = train)

的尝试
mtry

1 个答案:

答案 0 :(得分:1)

有几个问题,

bestmtry <- tuneRF(train[, V2:V9], train$V1, stepFactor = 1.5, improve = 1e-5, ntree = 500)

有效。