Logistic Regression

Navjot Singh
3 min readJun 10, 2020

--

Before we dive into Logistic regression , let’s take a step back and review Linear Regression.

In linear Regression, the goal is to find the best fit line that can accurately predict the output for the continuous dependent variable.

Linear Regression predicts the probability of outcome can exceed 0 and 1 range but the probability range is 0 to 1 it means that the parts of the line that are above y= 1 and below y=0 does not make any sense in reference to logistic regression. So for that we have to change the regression line and make it fit by using sigmoid function.

Equation for Simple Linear Regression is

Now, if we apply this equation a sigmoid function and we put y in the sigmoid function and solve

And put it back into the first equation and get the logistic regression equation

Using this formula and we get line for logistic regression is the same as the slope or a trend line of linear regression.

Logistic regression estimates discrete values based in a given set of independent variables .We use logistic regression when we want our result to reflect the belongingness of data points in the dataset.

It is a classification and not a regression algorithm.

It predicts the probability logic function who’s value lies between 0–1. It is a statistical method for predicting binary classes . The outcome or target will be binary in nature.

Based on the new unseen objects, we assign them a category. When the object is above the threshold value the predicted value is 1 and when an object that lies below the threshold value the predicted value is 0.

The logistic regression model is used to model the probability of a certain class or event existing such as pass or fail, win or lose, alive or dead or healthy or sick.

Application

It is a widely used technique because it is very efficient, does not require too many computational resources, it’s highly interpretable, it doesn’t require input features to be scaled, it doesn’t require any tuning, it’s easy to regularize, and it outputs well-calibrated predicted probabilities.

Logistic regression does work better when you remove attributes that are unrelated to the output variable as well as attributes that are very similar (correlated) to each other. Therefore Feature Engineering plays an important role in regards to the performance of Logistic and also Linear Regression.

That’s all for Logistic Regression Machine learning Algorithm. Stay tuned for further blogs.

Thankyou

--

--

Navjot Singh

Machine learning enthusiast interested in making data actionable.