擅长:python、mysql、java
<p>尝试在<code>GridSearchCV(...)</code>中设置<code>iid=False</code>,然后进行比较。你知道吗</p>
<p>根据文件:</p>
<blockquote>
<pre><code>iid : boolean, default=True
If True, the data is assumed to be identically distributed across
the folds, and the loss minimized is the total loss per sample,
and not the mean loss across the folds.
</code></pre>
</blockquote>
<p>因此,当<code>iid</code>为真(默认情况下),测试分数的平均值包括指定的权重<a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/model_selection/_search.py#L725" rel="nofollow noreferrer">here in source code</a>:</p>
<pre><code> _store('test_%s' % scorer_name, test_scores[scorer_name],
splits=True, rank=True,
weights=test_sample_counts if iid else None)
</code></pre>
<p>请注意,培训分数不受其影响,因此还要交叉检查培训分数的平均值。你知道吗</p>