I am trying to classify some machine learning models in a binary classification using GridSearchCV. I want to classify the models with respect of score, best parameters and f2 score.
For the score and best parameters I used the code
scores = []
for model_name, mp in model_params.items():
clf = GridSearchCV(mp['model'], mp['params'], cv=5, return_train_score=False)
clf.fit(X_test, y_test)
scores.append({
'model': model_name,
'best_score': clf.best_score_,
'best_params': clf.best_params_
})
df = pd.DataFrame(scores,columns=['model','best_score','best_params'])
Which gives the best_score and best_params for all the models, but I am not able to do it find the f2 score of all the models. What should be the code?