我正在研究《泰坦尼克号》。但是,我遇到了一个问题,即模型不再运行,而是抛出了一个似乎与内存分配有关的错误。
Error: water.exceptions.H2OModelBuilderIllegalArgumentException: Illegal argument(s) for DRF model: DRF_model_R_1542172359909_24373_cv_1. Details: ERRR on field: _ntrees: The tree model will not fit in the driver node's memory (2.4 KB per tree x 500 > Zero ) - try decreasing ntrees and/or max_depth or increasing min_rows!
这是我的代码示例:
y<-"Survived"
x<-setdiff(names(newtrain_imp),y)
rf_mod<-h2o.randomForest(x,y,train_set,
nfolds = 10,
keep_cross_validation_predictions = T,
seed=233,
mtries = 8,#sampling default-1 set to al
ntrees = 500,
max_depth = 12,
validation_frame = validate_set,
binomial_double_trees = T)
答案 0 :(得分:2)
在使用h2o初始化h2o的过程中,init(max_mem_size = 8G)在此处设置希望h2o使用的RAM数量。