xgb_classification.py 文件源码

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

项目:jingjuSingingPhraseMatching 作者: ronggong 项目源码 文件源码
def buildEstimators(mode):
    if mode == 'train' or mode == 'cv':
        # best parameters got by gridsearchCV, best score: 1
        estimators = [('anova_filter', SelectKBest(f_classif, k='all')),
                      ('xgb', xgb.XGBClassifier(learning_rate=0.1,n_estimators=300,max_depth=3))]
        clf = Pipeline(estimators)
    elif mode == 'test':
        clf = pickle.load(open(join(classifier_path,"xgb_classifier.plk"), "r"))
    return clf
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号