22.02.2024 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

point to a discrete label (zero or one), we’ll compute the probability of a data

point’s belonging to the positive class.

Probabilities

If a data point has a logit that equals zero, it is exactly at the decision boundary

since it is neither positive nor negative. For the sake of completeness, we assigned

it to the positive class, but this assignment has maximum uncertainty, right? So,

the corresponding probability needs to be 0.5 (50%), since it could go either way.

Following this reasoning, we would like to have large positive logit values assigned

to higher probabilities (of being in the positive class) and large negative logit values

assigned to lower probabilities (of being in the positive class).

For really large positive and negative logit values (z), we would like to have:

Equation 3.4 - Probabilities assigned to different logit values (z)

We still need to figure out a function that maps logit values into probabilities.

We’ll get there soon enough, but first, we need to talk about…

Odds Ratio

"What are the odds?!"

This is a colloquial expression meaning something very unlikely has happened. But

odds do not have to refer to an unlikely event or a slim chance. The odds of getting

heads in a (fair) coin flip are 1 to 1 since there is a 50% chance of success and a 50%

chance of failure.

Let’s imagine we are betting on the winner of the World Cup final. There are two

countries: A and B. Country A is the favorite: It has a 75% chance of winning. So,

Country B has only a 25% chance of winning. If you bet on Country A, your chances

of winning—that is, your odds (in favor)—are 3 to 1 (75 to 25). If you decide to test

your luck and bet on Country B, your chances of winning—that is, your odds (in

favor)—are 1 to 3 (25 to 75), or 0.33 to 1.

212 | Chapter 3: A Simple Classification Problem

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

Saved successfully!

Ooh no, something went wrong!