Artificial Intelligence

What Logistic Regression


Logistic regression is also one type of regression problem. But it is generally used for classification purposes with the help of logistic function. It uses probabilities rather than the actual value.
Unlike Linear regression, the dependent variables can only take a limited number of values i.e., the dependent variable is “categorical” rather than the continuous values.
When the possible outcome is only two such as spam or not spam. Then it is known as “Binary Logistic Regression”.
A Binary logistic model has a dependent variable with two possible values like Pass/Fail, Yes/No, Male/Female, Healthy/Sick, Win/Lose, etc. which are represented as 0 or 1.
There may be a “n” number of independent variables, each of type Binary or Continuous.
Note: The main difference between Linear Regression and Logistic Regression is that the target/ output value which is to be predicted is a Binary value (0 or 1) rather than a numeric value.
Some of the examples are:
1)      Predicting the probability of failure of a product.
2)      Employees' Churn prediction.
3)      Cancer prediction.
4)      Likelihood of a customer purchasing particular products based on his previous purchases.
5)      Predicting mortality of the injured patients.
Let’s see in detailed how Logistic regression differ from the Linear regression
In Linear regression, the output is the weighted sum of the inputs.
Logistic Regression is a generalized Linear Regression in the sense that we don’t output the weighted sum of the inputs directly, but we pass it through a function that can map any value between 0 and 1.
As of now, you understood some basic ideas behind Logistic regression. But may you have a doubt that
Why can’t Linear regression can be used for classification tasks?
Let me give a broad picture so that you get an idea behind it.
Note: If we take the weighted sum of inputs as the output as we do in Linear regression, the value can be more than 1, but we want a value between 0 and 1. That’s why linear regression can’t be used for classification tasks.
Now let’s understand it with the help of the diagram
In the above figure, the left-hand side represents the neuron representation of the Linear Regression model and the right-hand side represents the Logistic regression model.
So, you can see from the figure the only difference between Linear Regression and Logistic Regression is that the output of the linear regression model is passed through an “activation function” i.e. Sigmoid function that maps any real value between 0 and 1
Are you looking For python programming courses in Pune Then Join Us 

Comments

Popular posts from this blog

good morning shayari for my love

for my bestie