22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 3.16 - Trade-offs for two different thresholds

I guess we earned the right to call it a curve now :-)

Raising the threshold moves you to the left along both curves.

Can we just connect the dots and call it a curve for real? Actually, no, not yet.

ROC and PR Curves

We need to try out more thresholds to actually build a curve. Let’s try multiples of

10%:

threshs = np.linspace(0,1,11)

Figure 3.17 - Full curves

Cool! We finally have proper curves! I have some questions for you:

• In each plot, which point corresponds to a threshold of zero (every prediction

is positive)?

• In each plot, which point corresponds to a threshold of one (every prediction is

negative)?

Classification Threshold | 253

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!