O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logistic regression

Logistic regression is a probabilistic model that is, its predictions are bounded between 0 and 1, and for binary classification, equate to the model's estimate of the probability of the data point belonging to the positive class. Logistic regression is one of the most widely used linear classification models.

As mentioned earlier, the link function used in logistic regression is this logit link:

1 / (1 + exp(- WTx))   a

The related loss function for logistic regression is the logistic loss:

log(1 + exp(-y WTx)) 

Here, y is the actual target variable (either 1 for the positive class or -1 for the negative class).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required