【发布时间】:2017-07-22 13:49:12
【问题描述】:
是否可以通过一些变通方法从 cross_val_score 获取分类报告?我正在使用嵌套交叉验证,我可以在这里为模型获得各种分数,但是,我想看看外循环的分类报告。有什么建议吗?
# Choose cross-validation techniques for the inner and outer loops,
# independently of the dataset.
# E.g "LabelKFold", "LeaveOneOut", "LeaveOneLabelOut", etc.
inner_cv = KFold(n_splits=4, shuffle=True, random_state=i)
outer_cv = KFold(n_splits=4, shuffle=True, random_state=i)
# Non_nested parameter search and scoring
clf = GridSearchCV(estimator=svr, param_grid=p_grid, cv=inner_cv)
# Nested CV with parameter optimization
nested_score = cross_val_score(clf, X=X_iris, y=y_iris, cv=outer_cv)
我想在此处查看评分值旁边的分类报告。 http://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html
【问题讨论】:
标签: machine-learning scikit-learn classification cross-validation