I’m training my model for a dataset given in a competition. The primary metric for evaluation is Mean F1-Score. But when I use fbeta(beta=1), I get a error
metrics = [error_rate, fbeta(beta=1)]
>>> TypeError: fbeta() missing 2 required positional arguments: ‘y_pred’ and ‘y_true’
For a metric, you need to pass a function or an instance of one of the fastai metric classes.
fbeta is a function. You are trying to evaluate the fbeta function, instead of constructing a list of two functions. Try this (appears in one of the Lesson notebooks):
f_score = partial(fbeta, beta=1) # f_score is a new function, fbeta with one parameter set
metrics = [error_rate, f_score]
Or use the FBeta class, construct an instance, set its beta, pass the instance as a metric.