cv_bayes.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:parisfellows_anonymize 作者: armgilles 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号