2017-02-09 103 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以下巖芯:) **