How to refit GridSearchCV on Multiclass problem
Nevermind, I realized my mistake.
precision and recall don't work with multiclass data. They should be replaced by precision_macro and recall_macro instead.
Speaking of which, the one place where I tried using them on the code should be also changed into:
best_precision = clf.cv_results_['mean_test_precision_macro'][i]
best_recall = clf.cv_results_['mean_test_recall_macro'][i]