Explain and use sigmoid functions and logistic regression Logistic regression The above chart s...

  • Explain and use sigmoid functions and logistic regression

Logistic regression

The above chart summarizes the difference between linear regression and logistic regression: Both start by computing a linear function of the inputs, denoted by the Greek letter ∑∑ (capital sigma) which is often used to denote addition. In logistic regression, the result is then passed through the sigmoid function.Logistic regression

The above chart summarizes the difference between linear regression and logistic regression: Both start by computing a linear function of the inputs, denoted by the Greek letter ∑∑ (capital sigma) which is often used to denote addition. In logistic regression, the result is then passed through the sigmoid function.

The mathematical formula for the sigmoid function (see below) may look a bit intimidating but it serves a simple purpose: it converts any number to value between 00 and 11. The larger the input to the sigmoid function, the closer the output is to 1.01.0, and the smaller the input, the closer the output is to 0.00.0. For example, the value 0.00.0 is converted into 0.50.5 whereas the value 10.010.0 is converted into 0.99995460.9999546, which is a tiny bit short of 1.01.0. Likewise, the value −10−10 is converted into 0.00004540.0000454 which is the same tiny bit greater than 0.00.0.

Since the output value is a number between 00 and 11, it can be interpreted as a probability. This is useful because we will use logistic regression to predict the probability of something happening, instead of using a numerical value (such as a price in euros or the amount of carbon emissions in kilograms). If we use logistic regression in medical diagnosis, the output of the model can be for example the probability of a certain disease. Or if we are trying to tell whether a smiley face is happy or not, the output of the model can be the probability that it's happy. When there are exactly two alternatives (happy or not, disease or no disease), the probability of the second outcome is of course one minus the probability of the first.

The model can then be used to classify different items into two classes so that we read the output from the model and interpret it as the probability of one of the classes. We often label the classes as 00 and 11, and let the output of the model be the probability of class 11.

1.