sklearn_data.py 文件源码

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

项目:-Classification-on-Chinese-Magazine- 作者: lixiaosi33 项目源码 文件源码
def evaluate_cross_validation(clf, X, y, K):
    # create a k-fold croos validation iterator of k=5 folds
    cv = KFold(len(y), K, shuffle=True, random_state=0)
    # by default the score used is the one returned by score method of the estimator (accuracy)
    scores = cross_val_score(clf, X, y, cv=cv)
    print scores
    print ("Mean score: {0:.3f} (+/-{1:.3f})").format(
        np.mean(scores), sem(scores))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号