The Superman Algorithm: Logistic Regression
What is Logistic Regression?
Logistic Regression is one of the most popular Machine Learning algorithms for binary classification. It is a simple but powerful Algorithm which can be used as baseline, easy implementation, and can do well enough in many tasks.
An example of a Logistic Regression problem is an algorithm used for cancer detection that takes screened picture as an input and give output as patient has cancer (1) or not (0).
Why Logistic Regression?
- It does not require much computational resources, highly interpretable, doesn’t require input features to be scaled, and its outputs well-calibrated predicted probabilities.
- We can achieve 95% accuracy with MNIST dataset using Logistic Regression only, it’s not a great result, but its more than good enough to make sure you pipeline works.
- Application in Deep Learning, we can think of each neuron in the network as a Logistic Regression. Moreover, the final layer of a neural network can also be a simple logistic regression.
How it works?
It’s a classification algorithm used when response variable is categorical. The idea of Logistic Regression is to find a relationship between features and probability of particular outcome.
These probabilities must then be transformed into binary values in order to make a prediction. This is the task of the logistic function, also called Sigmoid function. The Sigmoid-Function is S-shaped curve that can take any real-valued number and map it into a value between the range of 0 and 1. This value between 0 and 1 will then be transformed into either 0 or 1 using a threshold classifier.
The picture below illustrates the steps that logistic regression gives the desired output:
Below you can see how the logistic function (Sigmoid function) which is converted from Linear regression:
By: Sumit Ranjan