# n_iter controls the number of searches rand = RandomizedSearchCV(knn, param_dist, cv=10, scoring='accuracy', n_iter=10, random_state=5, return_train_score=False) rand.fit(X, y) pd.DataFrame(rand.cv_results_)[['mean_test_score', 'std_test_score', 'params']] #DataFrame mean_test_score std_test_score params 0 0.973333 0.032660 {'weights': 'distance', 'n_neighbors': 16} 1 0.966667 0.033333 {'weights': 'uniform', 'n_neighbors': 22} 2 0.980000 0.030551 {'weights': 'uniform', 'n_neighbors': 18} 3 0.966667 0.044721 {'weights': 'uniform', 'n_neighbors': 27} 4 0.953333 0.042687 {'weights': 'uniform', 'n_neighbors': 29} 5 0.973333 0.032660 {'weights': 'distance', 'n_neighbors': 10} 6 0.966667 0.044721 {'weights': 'distance', 'n_neighbors': 22} 7 0.973333 0.044222 {'weights': 'uniform', 'n_neighbors': 14} 8 0.973333 0.044222 {'weights': 'distance', 'n_neighbors': 12} 9 0.973333 0.032660 {'weights': 'uniform', 'n_neighbors': 15}