@pytest.mark.parametrize('SearchCV', [HalvingGridSearchCV, HalvingRandomSearchCV])
def test_select_best_index(SearchCV):
    'Check the selection strategy of the halving search.'
    results = {'iter': np.array([0, 0, 0, 0, 1, 1, 2, 2, 2]), 'mean_test_score': np.array([4, 3, 5, 1, 11, 10, 5, 6, 9]), 'params': np.array(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])}
    best_index = SearchCV._select_best_index(None, None, results)
    assert (best_index == 8)
Check the selection strategy of the halving search.
@pytest.mark.parametrize('SearchCV', [HalvingGridSearchCV, HalvingRandomSearchCV])
def test_select_best_index(SearchCV):
    
    results = {'iter': np.array([0, 0, 0, 0, 1, 1, 2, 2, 2]), 'mean_test_score': np.array([4, 3, 5, 1, 11, 10, 5, 6, 9]), 'params': np.array(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])}
    best_index = SearchCV._select_best_index(None, None, results)
    assert (best_index == 8)