One of the first things to know about Logistic Regression is that:• It is a Linear Model.
That means output of this model depends on the linear combination of it's features. Having said that: As a first step, let's create a linear combination of the features of the dataset with features :where is the intercept, and are the coefficients of the features .
Geometric Intuition
This equation of linear combination of features resembles the equation of a plane.The equation of a plane in three-dimensional space is a linear equation that represents all the points that lie on the plane. The general form of the equation of a plane is:
Formula for Distance from a Point to a PlaneFor a point , the distance from the point to the plane is given by:
Second thing to remember about Logistic Regression is that: • It is a Binary classification model.
But how does that matter?
Being a linear model: we can say that decision boundary for Logistic Regression would be line in 2D, plane in 3D and hyperplane in nD. Being a binary classification model: we can say that points will lie on either side of the decision boundary. This means that distance of a point on the decision boundary will have the following expression set to 0: So: D = 0 for points on the decision boundary. Equivalently, we can say:Or For Our Logistic Regression Model:
So the way to decide the class of a point is: If this Beta expression > 0: point lies above the plane (on the one side of the plane) And if this expression < 0: point lies below the plane (on the other side of the plane)Logistic (or Sigmoid) Comes Into Picture
Now, statisticians knew that the range of To convert the Beta expression into a range of Probability and to also follow the properties of a Probability, we can pass it through a Logistic (or Sigmoid) expression: Logistic function is: For Logistic Regression, we write: Very Important Point :: This expression: is the probability that data point in consideration lies in class Y=1.Bonus Video:
Logistic Regression Indepth Intuition - Part 1 Logistic Regression Indepth Intuition - Part 2
Saturday, August 10, 2024
Getting the Geometric Intuition Behind Logistic Regression
To See All ML Articles: Index of Machine Learning
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment