unExtGBDTEnsemble.py 文件源码

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

项目:CreditScoring 作者: cqw5 项目源码 文件源码
def ExtGBDTEnsemblePredict(sub_clf_num, predict_x):
    """
    ????????
    :param sub_clf_num: ??????
    :param predict_x: ??????feature
    :return: socre: ndarray, ????
    """
    total_score = np.zeros(len(predict_x))  # ?????????????????
    for i in range(sub_clf_num):
        predict_X = xgb.DMatrix(predict_x)
        model_file = '../model/model' + str(i)
        bst = pickle.load(open(model_file, 'r'))
        predict_y = bst.predict(predict_X)
        total_score += predict_y
    score = total_score / sub_clf_num
    return score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号