Logistic Regression
Logistic Regression
Logistic Regression-
Logistic regression is a supervised machine learning algorithm mainly used for
binary classification where we use a logistic function, also known as a sigmoid
function that takes input as independent variables and produces a probability
value between 0 and 1. For example, we have two classes Class 0 and Class 1 if
the value of the logistic function for an input is greater than 0.5 (threshold
value) then it belongs to Class 1 it belongs to Class 0. It’s referred to as
regression because it is the extension of linear regression but is mainly used for
classification problems. The difference between linear regression and logistic
regression is that linear regression output is the continuous value that can be
anything while logistic regression predicts the probability that an instance
belongs to a given class or not.
It can be either Yes or No, 0 or 1, true or False, etc. but instead of giving the
exact value as 0 and 1, it gives the probabilistic values which lie between 0
and 1.
It maps any real value into another value within a range of 0 and 1. The
value of the logistic regression must be between 0 and 1, which cannot go
beyond this limit, so it forms a curve like the “S” form.
The S-form curve is called the Sigmoid function or the logistic function.
variables
It required linear
relationship between It not required linear
dependent and relationship.
7 independent variables.
Sigmoid Function
Now we use the sigmoid function where the input will be z and we find the
probability between 0 and 1. i.e predicted y.
Sigmoid function
As shown above, the figure sigmoid function converts the continuous variable
data into the probability i.e. between 0 and 1.