The logistic model

We have almost all the elements to turn a simple linear regression into a simple logistic regression. Let's begin with the case of only two classes or instances, for example ham/spam, safe/unsafe, cloudy/sunny, healthy/ill, or hotdog/not hotdog. First, we codify these classes by saying that the predicted variable, , can only take two values, 0 or 1, that is, . Stated this way, the problem sounds similar to the coin-flipping example from Chapter 2, Programming Probabilistically and Chapter 3, Modeling with Linear Regression.

We may remember we used the Bernoulli distribution as the likelihood. The difference with the coin-flipping problem is that now  is not going to be generated from a beta distribution; instead,  is going to be defined by a linear model with the logistic as the inverse link function. Omitting the priors we have:

Notice that the main difference with the simple linear regression from Chapter 3, Modeling with Linear Regression is the use of a Bernoulli distribution instead of a Gaussian distribution, and the use of the logistic function instead of the identity function.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.109.235