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.
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])
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)
Thank you!
when I used multiple metrics in tabular_learner
, I get;
Exception occurred in
Recorderwhen calling event
after_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.