当前位置:网站首页>[AI practice] xgbgressor model accelerates training and uses GPU to train xgbgressor in seconds

[AI practice] xgbgressor model accelerates training and uses GPU to train xgbgressor in seconds

2022-06-23 07:14:00 szZack

XGBRegressor Model acceleration training , Use GPU Second training XGBRegressor

  • Machine learning model

      XGBRegressor
    
  • Environmental Science

    • Ubuntu 18.04
    • python3.6.9
    • TensorFlow 2.4.2
    • cuda 11.0
    • xgboost 1.5.2
  • Core code

    x, y = load_data()
    model = xgb.XGBRegressor(learning_rate=0.05,
                             n_estimators=420,
                             max_depth=3,
                             min_child_weight=1,
                             gamma=0.0,
                             subsample=0.8,
                             colsample_bytree=0.8,
                             scale_pos_weight=0.8,
                             seed=42,
                             tree_method='gpu_hist',
                             gpu_id=3)
    
	output = model.fit(x, y)

stay 2 Millions of data 34.344 s:

real    0m34.344s
user    4m46.866s
sys     0m22.178s

among , Important parameters :

	tree_method='gpu_hist'
	gpu_id=3  Indicates using the 3 block gpu
原网站

版权声明
本文为[szZack]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230623566762.html