How to use AUROC with cnn_learner in Fast AI?

(Bilal) #1

Hi All,

I checked the forum and found a few threads talking about how to use AUROC with Fast AI. This is how it was mostly suggested.

acc_02 = partial(accuracy_thresh, thresh=0.2)
f_score = partial(fbeta, thresh=0.2, beta=1)
learn = cnn_learner(data, arch, metrics=[acc_02, f_score], callback_fns=AUROC)

But I got the following error:

Any idea what am I doing wrong here.

Thanks a lot
Kind Regards,
Bilal

1 Like

#2

You need to instantiate it: pass AUROC().

0 Likes

(Bilal) #3

This is what Fast AI return when I pass the following arguments:

learn = cnn_learner(data, arch, metrics=[acc_02, f_score], callback_fns=AUROC())

0 Likes

#4

Oh, you need to pass it in the metrics, not the callbacks.

0 Likes

(Bilal) #5

Thanks for the response.

I now used the following commands:

learn = cnn_learner(data, arch, metrics=[acc_02, f_score, AUROC()])

And this generates the following output:

1 Like