0
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
歡迎SO - 請您提供一個[重複的例子(http://stackoverflow.com/questions/5963269/how-to -make-A-大-R再現的-示例) – C8H10N4O2