xgb_classification.py 文件源码

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

项目:jingjuSingingPhraseMatching 作者: ronggong 项目源码 文件源码
def train_evaluate_stratified(clf, X, y, labels):
    skf = StratifiedKFold(y, n_folds=10)
    for fold_number, (train_index, test_index) in enumerate(skf):
        X_train, y_train = X[train_index], y[train_index]
        X_test, y_test = X[test_index], y[test_index]
        clf.fit(X_train, y_train)
        y_pred = clf.predict(X_test)
        save_results(y_test, y_pred, labels, fold_number)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号