<p dir="auto">I frequently get asked about post-pruning. Often using single trees is important for interpretability, and post-pruning can help both interpretability and generalization performance.<br>
[I'm surprised there is no open issue on this, but I couldn't find one]</p>
<p dir="auto">Everything is in the title. This behaviour comes from the <code class="notranslate">__iter__(self)</code> method of <strong>ParameterSampler</strong>. By creating a generator that randomly picks each time values for every parameter independently, there is no way to prevent collision.<br>
If <code class="notranslate">n_iter</code> is greater than a significant fraction of the grid cardinal, collision happens quite often, and <strong>RansomizedSearchCV</strong> launches the exact same CV several times. It seems at least inelegant, at most a significant waste of computational time :-)<br>
I would also suggest a check on <code class="notranslate">n_iter</code> to be bounded by the grid cardinal, when <strong>RandomizedSearchCV</strong> becomes <strong>GridSerachCV</strong>.</p>