A working example that I used recently when building a deep learning model in version 2.8.6 in h2o. The model was saved in hdf. For the latest version, you probably have to remove the class = T switch and replace the data with training_frame
library(h2o) h = h2o.init(ip="xx.xxx.xxx.xxx", port=54321, startH2O = F) cTrain.h2o <- as.h2o(h,cTrain,key="c1") cTest.h2o <- as.h2o(h,cTest,key="c2") nh2oD<-h2o.deeplearning(x =c(1:12),y="tgt",data=cTrain.h2o,classification=F,activation="Tanh", rate=0.001,rho=0.99,momentum_start=0.5,momentum_stable=0.99,input_dropout_ratio=0.2, hidden=c(12,25,11,11),hidden_dropout_ratios=c(0.4,0.4,0.4,0.4), epochs=150,variable_importances=T,seed=1234,reproducible = T,l1=1e-5, key="dn") hdfsdir<-"hdfs://xxxxxxxxxx/user/xxxxxx/xxxxx/models" h2o.saveModel(nh2oD,hdfsdir,name="DLModel1",save_cv=T,force=T) test=h2o.loadModel(h,path=paste0(hdfsdir,"/","DLModel1"))
0xF
source share