Is there any confusion between Linear regression and Logistic regression?

Is there any confusion between Linear regression and Logistic regression? So here is the solution in simple terms.

In this article, I tried to not include any mathematical terms so that you will know some basic differences between these terms.

No alt text provided for this image


Linear Regression: - It is based on a supervised regression algorithm. Regression terms classify as here we predict the value by an integer number like for example predicting the house price.

No alt text provided for this image

We can define it is as Linear regression is used to estimate the dependent variable in case of a change in the independent variable. For example, you started a small business and earn 200$ on the first day, 400$ on the second day and 600$ on the third day then you can easily say how much you will earn on the fourth day? 800$ so you just did linear Regression.

No alt text provided for this image

Formula used, here ' b ' is slope and ' a ' is intercept which provides freedom to slope for providing best fit line.

In linear regression, we don’t require any activation function neither any threshold value. And we use Root mean square error(RMSE) to predict the next value. And it is based on the least square estimation.

Here we draw the best fit line which should touch the maximum point or we can say that when we plot the training datasets then a straight line can be drawn that touches maximum points.

No alt text provided for this image


From this graph we can easily understand that we want best fit line which covers all the point with minimum distance.


Linear regression assumes the normal or Gaussian distribution of the dependent variable.

Logistic Regression:- It is based on a supervised classification algorithm.

The classification term signifies as 1 or 0. For example to predict whether an email is spam (1) or not(0), whether the tumour is malignant (1) or not(0).

No alt text provided for this image

In logistic Regression, we require an activation function to convert a linear regression equation to a logistic regression equation. And here we add threshold value.

No alt text provided for this image

It is based on the concept of maximum likelihood estimation. And here we used to calculate the probability of an event. It assumes the binomial distribution of the dependent variable.

No alt text provided for this image


A familiar example to understand term logistic regression easily.

Credit Card Fraud Detection

No alt text provided for this image

The Credit Card Fraud Detection problem is of significant importance to the banking industry because banks each year spend hundreds of millions of dollars due to fraud. 

When a credit card transaction happens, the bank makes a note of several factors. For instance, the date of the transaction, amount, place, type of purchase, etc. Based on these factors, they develop a Logistic Regression model of whether or not the transaction is a fraud.

For instance, if the amount is too high and the bank knows that the concerned person never makes purchases that high, they may label it as a fraud.

Thank you for your precious time hope so it will be beneficial for understanding the quick concepts.

要查看或添加评论,请登录

Deepankar Pathak的更多文章

  • K-Nearest Neighbours Algorithm from scratch.

    K-Nearest Neighbours Algorithm from scratch.

    K-Nearest Neighbours Algorithm from scratch. In simple terms, we can say that Similar things exist in closer proximity.

    2 条评论
  • 5000+ LinkedIn Family members.

    5000+ LinkedIn Family members.

    Today I reached the '5000+ connection’ mark on LinkedIn. As I write this post, this milestone feels as important to me…

社区洞察

其他会员也浏览了