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