Logistic Regression

Ujjwal Khabrani
3 min readDec 9, 2020

In this blog, I have discussed one of the most used machine learning algorithms i.e. Logistic Regression. I have briefly discussed its concepts, types, and where it can be used.

Let’s start by understanding what is Regression?

It is a powerful statistical analysis technique. In this a dependent variable of our interest is used to predict the values of other independent variables in a data-set.

As now you have understood about regression we will jump to our main topic

Logistic Regression

Figure 1- Logistic Regression Model

Logistic Regression is a machine learning algorithm that is used for the classification of problems. It is based on concepts of probability and this algorithm is used to solve a classification problem. Let’s understand this with the help of an example:

Ex: When a person applies for a loan from a bank, banks are interested in checking whether the applicant will default in the future or not? Here the logistic regression algorithm comes into play for banks. In this logistic regression is used to make a prediction of the probability, the prediction will fall in [0, 1]. From the outcome, we can predict like if the applicant gets above 0.5 means chances of default are more and the bank should not give the loan, if chances are less than 0.5 then the bank should give the loan.

Figure 2- Graph of Logistic Regression

The range of linear regression is from negative infinity to positive infinity, not in [0, 1]. Then the sigmoid function is introduced to solve this problem. The sigmoid function gives an S-shaped curve and saturates when its argument is very positive or very negative.

Figure 3- Sigmoid Function

Types of Logistic Regression:

1. Binary Logistic Regression: The target variable has only two possible outcomes such as Spam or Not Spam, Cancer, or No Cancer.

2. Multinomial Logistic Regression: The target variable has three or more nominal categories such as predicting the type of Wine.

3. Ordinal Logistic Regression: the target variable has three or more ordinal categories such as restaurant or product rating from 1 to 5.

Use Cases

Following are the use cases where we can use logistic regression:

Weather Prediction, Determining Illness, Demo, Collecting Data, Analyzing Data, Data Wrangling, Test and Train Data

Figure 4- Weather prediction through Logistic regression model

Conclusion:

In this blog, I have presented you with the basics of logistic regression and its uses. I hope it was helpful to you. Happy Reading!!

--

--