79213506

Date: 2024-11-22 03:14:45
Score: 4
Natty:
Report link

I have the same problem when using add_metric() to add metric "f1-macro" in PyCaret. My code is as following:

def my_f1(y_true, y_pred):
    return f1_score(y_true, y_pred, average='macro', )

my_f1 = make_scorer(my_f1, greater_is_better=True)
add_metric('f1_macro', 'F1-Macro', my_f1)

best = s.compare_models(sort='f1-macro', n_select=3)

It returns "AttributeError: '_Scorer' object has no attribute 'name'"

Reasons:
  • Blacklisted phrase (1): I have the same problem
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same problem
  • Low reputation (1):
Posted by: Ian Lin