def xgboostcv(max_depth,
learning_rate,
n_estimators,
# gamma,
# min_child_weight,
# max_delta_step,
subsample,
colsample_bytree,
ratio=131.708,
silent =True,
nthread = -1,
seed = 42):
return cross_val_score(XGBClassifier(max_depth = int(max_depth),
learning_rate = learning_rate,
n_estimators = int(n_estimators),
silent = silent,
nthread = nthread,
# gamma = gamma,
# min_child_weight = min_child_weight,
# max_delta_step = max_delta_step,
subsample = subsample,
colsample_bytree = colsample_bytree,
scale_pos_weight = ratio,
seed = seed),
X,
y,
scoring='f1',
cv=5).mean()
评论列表
文章目录