Output Multiple Metrics?

Is there a way to output multiple metrics at once or do I have to use cnn_learner each time?

Here is a screenshot of my code so far.

You would simply need to pass them as a list

for example:
learner = cnn_learner(dls, resnet34, metrics=[F1Score(), error_rate])

1 Like

sure, you can do this:

avg = 'macro'
metrics=[accuracy, Precision(average=avg), Recall(average=avg), F1Score(average=avg)]

learn = can_learner(dls, resnet34, metrics=metrics)
2 Likes

Thank you!

when I used multiple metrics in tabular_learner, I get;

Exception occurred in Recorderwhen calling eventafter_batch: unsupported operand type(s) for *: 'AccumMetric' and 'int'

Here is my implementation.

# Declare a tabular learner
learn = tabular_learner(dls=dls,
                        layers=[50, 10],
                        metrics=[accuracy, F1Score(average="macro"), RocAuc])
# Find the optimum learning rate
learn.lr_find(suggest_funcs=(slide, valley))
# Fit the model
learn.fit(n_epoch=20, lr=0.03,
          cbs=[SaveModelCallback,
               ReduceLROnPlateau,
               EarlyStoppingCallback(patience=5)])

I found that RocAuc was causing such an error. How should I be using it? I really appreciate any help you can provide.