python - 了解 SciKit Learn 简历验证分数

标签 python machine-learning scikit-learn

我试图理解运行 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

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

关于python - 了解 SciKit Learn 简历验证分数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30108044/

相关文章:

python - 删除各个子目录中相同的文件名

python - Scikit-learn:权重在岭回归中的作用

python - 值错误 : Number of features of the model must match the input

python - 来自 Spark 的 Parquet 文件被检测为 Linux 中的目录

c++ - 使用 Python/C API 在 Python-List 上使用 C++-Iterators?

python - 隐藏层的训练不会提高准确性

python - 如何显示一个句子中下一个单词的多个预测?

python - Scikit-learn 随机森林拟合方法中的值误差

python - 调用参数数量未知的函数 Python

python - 谷歌搜索给出重定向网址,而不是真实的网址python