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
xgb_classification.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录