i want to add the metric F2 score in pycaret but it’s not working when i run the column F2 is 0 but i tried without pycaret and it worked
‘from sklearn.metrics import make_scorer, fbeta_score
def f2_score(y_true, y_pred):
return fbeta_score(y_true, y_pred, beta=2)
f2_scorer = make_scorer(f2_score, greater_is_better=True)
clf1 = setup(df, target= target_column, train_size=0.8, fold=5)
add_metric(‘lol’, ‘AUPRC’, average_precision_score, target=’pred_proba’)
add_metric(‘fbeta’, ‘F2′, f2_score, target=’pred_proba’)
best = compare_models(include=[‘rf’, ‘xgboost’], fold=5)’
beluga_pickle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.