I know that GridSearchCV can take multiple inputs as their scorer, but I will have to choose a metric to optimise using refit.
Like so:
grid_search = GridSearchCV(
estimator=classifier,
param_grid=parameters,
scoring=['accuracy', 'f1', 'precision', 'recall'],
refit="accuracy", # Or any other value from `scoring` list)
As I understand, if I put
refit = accuracy here, the grid search will optimise the accuracy, meaning it will find the set of hyperparameters that will have the highest accuracy and I will be able to get the precision, recall and f1 score from cv_result
But what I want to do now is to optimise both accuracy and F1 score as my use case needs both metrics, is there a way to achieve this? I scoured the Internet for the solution but to no avail.