<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">As a user who specify weighted metrics/scoring such as balanced accuracy, I would like the scoring <code class="notranslate">GridSearchCV</code> uses for optimising and <code class="notranslate">best_score_</code> to be weighted as well. Based on current documentation, I think it is currently simply a mean, so I do not aware if this has been tackled/asked before.</p>
<p dir="auto">I am thinking about this since my data is imbalanced, and saw <a href="https://stackoverflow.com/questions/47572191/scikit-learn-scoring-in-gridsearchcv" rel="nofollow">this</a> post in SO too.</p>
<p dir="auto">The mean seems to work fine when <code class="notranslate">StratifiedKFold</code> with minority class is multiple of <code class="notranslate">K</code>. If not (where the number minority class in each fold can be different) the scoring could be different with the 'combined scoring'. However, this is not as severe as doing this in <code class="notranslate">LeaveOneOut</code>.</p>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">When the user specify built-in weighted scoring, record the validation results for all folds and calculate scoring from combined validation result.</p>
<p dir="auto">This can be default behavior or an option to turn this on/off. However, I couldn't see why people who specify weighted metrics want to turn this off.</p>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>
<h4 dir="auto">Description</h4>
<p dir="auto"><code class="notranslate">GridSearchCV</code> and <code class="notranslate">RandomizedSearchCV</code> do not allow for passing parameters to the <code class="notranslate">scorer</code> function. This could be made possible by adding an extra <code class="notranslate">scorer_params</code>, similar to the <code class="notranslate">fit_params</code> argument.</p>
<p dir="auto">For consistency with <code class="notranslate">fit_params</code>, special care would have to be paid to sample weights. Weights fed through <code class="notranslate">fit_params</code> are currently well-distributed across training folds. Similarly,  weights fed through <code class="notranslate">scorer_params</code> would have to be distributed across validation folds.</p>
<p dir="auto">Is adding this feature under consideration?</p>
<p dir="auto">If not, should I give it a try?</p>
<p dir="auto">(Nota: follow-up issue to the closed <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="198979024" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/8156" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/8156/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/8156">#8156</a>. I believed the change in focus required a new thread.)</p>