2017-02-09 48 views
0

它有并行在XGBoost机器学习技术

XGBoost

的并行执行

我想给它的参数,以优化XGBoost执行做nthread = 16,在我的系统有24个核心。但是当我训练我的模型时,在模型训练的任何时候,它似乎甚至不会跨越CPU使用率的20%左右。 代码片段如下: -

param_30 <- list("objective" = "reg:linear", # linear 
       "subsample"= subsample_30, 
       "colsample_bytree" = colsample_bytree_30, 
       "max_depth" = max_depth_30, # maximum depth of tree 
       "min_child_weight" = min_child_weight_30, 
       "max_delta_step" = max_delta_step_30, 
       "eta" = eta_30, # step size shrinkage 
       "gamma" = gamma_30, # minimum loss reduction 
       "nthread" = nthreads_30, # number of threads to be used 
       "scale_pos_weight" = 1.0 
) 
model <- xgboost(data = training.matrix[,-5], 
       label = training.matrix[,5], 
       verbose = 1, nrounds=nrounds_30, params = param_30, 
       maximize = FALSE, early_stopping_rounds = searchGrid$early_stopping_rounds_30[x]) 

请我如何能提高CPU利用率和加快执行效率模型训练给我解释一下(如果可能的话)。 R中的代码有助于进一步理解。

假设: - 这是关于XGBoost

+0

欢迎SO - 请您提供一个[重复的例子(http://stackoverflow.com/questions/5963269/how-to -make-A-大-R再现的-示例) – C8H10N4O2

回答

0

这是一个猜测 - [R包执行......但我有这种事发生在我...

你花得多时间在并行期间通信,并没有得到CPU绑定。底线是你的数据不够大(行和列),和/或你的树不够深,max_depth,以保证许多内核。太多的开销。 xgboost将拆分评估并行化,以便大数据上的深层树可以使CPU嗡嗡声保持最大。

我已经训练了很多模型,其中单螺纹优于8/16核心。太多的时间切换,没有足够的工作。

**更多的数据,更深入TREES以下岩芯:) **