Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.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
R 使用H2O随机林时发生堆使用错误_R_H2o - Fatal编程技术网

R 使用H2O随机林时发生堆使用错误

R 使用H2O随机林时发生堆使用错误,r,h2o,R,H2o,我在使用h2o.0时收到此错误。请参阅下面的函数调用和相关错误 base_line_rf <- h2o.randomForest(x=2:ncol(train), y=1, ntrees = 10000, mtries = ncol(train)-1,

我在使用h2o.0时收到此错误。请参阅下面的函数调用和相关错误

base_line_rf <- h2o.randomForest(x=2:ncol(train),
                                y=1,
                                ntrees = 10000,
                                mtries = ncol(train)-1,
                                training_frame = train,
                                model_id <- model_id,
                                stopping_rounds = 5,
                                stopping_tolerance = 0,
                                stopping_metric = "AUC",
                                binomial_double_trees = TRUE
)
这个错误的原因是什么


谢谢

基于您的问题,您需要设置H2O群集以使用更多内存运行,以适应10000树随机林。看起来H2O集群(Java进程)是使用8GB内存创建的,但是基于10000树设置,它需要比给定8GB更多的内存

max_mem_size 7624.720384 MB (Configured)
heapUsedGC - 7626.295912 MB (Required)
看起来您正在R中使用H2O,因此可以在H2O.init()函数中传递max_mem_size=12G(意味着H2O集群将以12GB内存开始),如下所示,该函数应符合您的随机林要求:

h2o.init(max_mem_size="12G")
您还可以使用以下命令检查H2O群集的详细信息:

> h2o.clusterInfo()
R is connected to the H2O cluster: 
    H2O cluster uptime:         19 seconds 80 milliseconds 
    H2O cluster version:        3.14.0.3 
    H2O cluster version age:    27 days  
    H2O cluster name:           H2O_started_from_R_avkashchauhan_hwc594 
    H2O cluster total nodes:    1 
    H2O cluster total memory:   10.65 GB <=== This is the max memory size
    H2O cluster total cores:    8 
    H2O cluster allowed cores:  8 
    H2O cluster healthy:        TRUE 
    H2O Connection ip:          localhost 
    H2O Connection port:        54321 
    H2O Connection proxy:       NA 
    H2O Internal Security:      FALSE 
    H2O API Extensions:         XGBoost, Algos, AutoML, Core V3, Core V4 
    R Version:                  R version 3.4.1 (2017-06-30) 
>h2o.clusterInfo()
R连接到H2O簇:
H2O群集正常运行时间:19秒80毫秒
H2O群集版本:3.14.0.3
H2O群集版本年龄:27天
H2O集群名称:H2O_从_R_avkashchauhan_hwc594开始
H2O群集总节点数:1

H2O群集总内存:10.65 GB请提供一个具有示例数据的可复制示例:您可能需要更多内存,请检查。这是一个断言错误--默认情况下断言被禁用,因此您必须启用它们(用于调试?)。如果您再次关闭它们,它可能会起作用,但也有可能稍后会弹出另一个相关错误。实际上,当您从R启动H2O时,断言在默认情况下处于启用状态,因此您可以尝试使用
H2O.init()
enable\u assertions=FALSE
将其关闭。
> h2o.clusterInfo()
R is connected to the H2O cluster: 
    H2O cluster uptime:         19 seconds 80 milliseconds 
    H2O cluster version:        3.14.0.3 
    H2O cluster version age:    27 days  
    H2O cluster name:           H2O_started_from_R_avkashchauhan_hwc594 
    H2O cluster total nodes:    1 
    H2O cluster total memory:   10.65 GB <=== This is the max memory size
    H2O cluster total cores:    8 
    H2O cluster allowed cores:  8 
    H2O cluster healthy:        TRUE 
    H2O Connection ip:          localhost 
    H2O Connection port:        54321 
    H2O Connection proxy:       NA 
    H2O Internal Security:      FALSE 
    H2O API Extensions:         XGBoost, Algos, AutoML, Core V3, Core V4 
    R Version:                  R version 3.4.1 (2017-06-30)