私は2つのループ(下記参照)を含むコードを作成しましたが、エラーが発生しました。どのようにこのループを作成できますか?添付正しくh2oパッケージenvに基づいてループを作成する方法。正しく
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE:
Can only append one column
私のコードです:
attach(iris)
train<-iris
test<-iris
invisible(capture.output(h2o.init(nthreads = -1))) # initalising with all cpu cores
trainHex <- as.h2o(train[1:200,])
testHex <- as.h2o(test)
x_names <- colnames(trainHex[1:4])
SEED<-c(123456789,12345678,1234567)
method<-c("Rectifier", "Tanh", "TanhWithDropout", "RectifierWithDropout", "Maxout", "MaxoutWithDropout")
Res<-data.frame()
for(i in 1:6){
for(j in 1:3){
system.time(ann <- h2o.deeplearning(
reproducible = TRUE,
seed = SEED[j],
x = x_names,
y = "Species",
training_frame = trainHex,epochs = 50,
standardize = TRUE,
nesterov_accelerated_gradient = T, # for speed
activation = method[i]
))
#ann
testHex$h20<-ifelse(predict(ann,newdata = testHex)>0.5,1,0)
testHex<-as.data.frame(testHex)
s<-xtabs(~Species +h20,data=testHex)
accuracy<-sum(diag(s))/sum(s)
tmp<-data.frame(seed=SEED[j],method=method[i],result=accuracy)
Res<-rbind(Res,tmp)
}
}
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE:
Can only append one column