如何加速包含 Xgboost 的 MultioutputClassifier? (python)
How to Accelerate MultioutputClassifier that contains Xgboost? (python)
我有以下代码,我想加速 MultioutputClassifier,我尝试为 MultioutputClassifier 编写 n_jobs = -1 但它变慢了,我尝试为 Xgboost 编写 n_jobs = -1 但是没有改变。 TREE_METHOD = 'gpu_hist' 参数也无法更改时间。
model = MultiOutputClassifier(
xgb.XGBClassifier(objective="binary:logistic",
colsample_bytree = 0.5,
gamma = 0.1,
learning_rate = 0.1,
max_depth = 20,
min_child_weight = 3,
estimators= 100,
reg_lambda=5.0,
subsample=0.7
))
知道如何加速吗?有没有我可以尝试的参数?
您可以尝试使用 Dask 进行一些分布式学习,如 here 所述。
除此之外,还有一些suggestions关于如何提高LightGBM(这是一个非常相似的算法)的训练速度,例如:
- 种植较浅的树(例如通过减少
max_depth
)
- 少种树(例如通过引入
early_stopping
)
- 使用更少的数据(例如通过
bagging
,您还可以寻找更多 colsample_
参数)
我有以下代码,我想加速 MultioutputClassifier,我尝试为 MultioutputClassifier 编写 n_jobs = -1 但它变慢了,我尝试为 Xgboost 编写 n_jobs = -1 但是没有改变。 TREE_METHOD = 'gpu_hist' 参数也无法更改时间。
model = MultiOutputClassifier(
xgb.XGBClassifier(objective="binary:logistic",
colsample_bytree = 0.5,
gamma = 0.1,
learning_rate = 0.1,
max_depth = 20,
min_child_weight = 3,
estimators= 100,
reg_lambda=5.0,
subsample=0.7
))
知道如何加速吗?有没有我可以尝试的参数?
您可以尝试使用 Dask 进行一些分布式学习,如 here 所述。 除此之外,还有一些suggestions关于如何提高LightGBM(这是一个非常相似的算法)的训练速度,例如:
- 种植较浅的树(例如通过减少
max_depth
) - 少种树(例如通过引入
early_stopping
) - 使用更少的数据(例如通过
bagging
,您还可以寻找更多colsample_
参数)