Time the CPU tests on Jenkins. (#6257)

* Time the CPU tests on Jenkins.
* Reduce thread contention.
* Add doc.
* Skip heavy tests on ARM.
This commit is contained in:
Jiaming Yuan
2020-10-21 08:19:07 +08:00
committed by GitHub
parent d1254808d5
commit 81c37c28d5
9 changed files with 29 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
from sklearn.model_selection import GridSearchCV
from sklearn.datasets import load_boston
import xgboost as xgb
import multiprocessing
if __name__ == "__main__":
print("Parallel Parameter optimization")
@@ -8,7 +9,7 @@ if __name__ == "__main__":
y = boston['target']
X = boston['data']
xgb_model = xgb.XGBRegressor()
xgb_model = xgb.XGBRegressor(n_jobs=multiprocessing.cpu_count() // 2)
clf = GridSearchCV(xgb_model, {'max_depth': [2, 4, 6],
'n_estimators': [50, 100, 200]}, verbose=1,
n_jobs=2)