了解 SciKit Learn CV 验证分数

Understand SciKit Learn CV Validation Scores

当 运行 一个 GridSearchCV 时,我试图理解 cv_validation_scores 的输出。文档没有充分解释这一点。

当我打印 grid_search.grid_scores_ 时,我得到一个包含项目的列表,如下所示:

[mean: 0.60000, std: 0.18002, params: {'tfidf__binary': True, tfidf__ngram_range': (1, 1)....

这是有道理的。但是,当我尝试解压缩 grid_scores 的每个实例时,我得到:

[0] same dictionary as above, makes sense
[1] score for all folds, makes sense
[2] a list that I don't understand, that looks like, "[ 0.75        0.33333333  0.66666667]"

这里报告的分数是多少?

正如我在邮件列表中发布的那样,the documentation 非常清楚:

grid_scores_ : list of named tuples

Contains scores for all parameter combinations in param_grid. Each entry corresponds to one parameter setting. Each named tuple has the attributes:

        parameters, a dict of parameter settings
        mean_validation_score, the mean score over the cross-validation folds
        cv_validation_scores, the list of scores for each fold

这些是交叉验证中每折的分数。

我取消订阅并重新订阅。似乎现在有效