Introduction to Logistic Regression

Sourav Kumar
3 min readDec 22, 2020

--

Introduction

Logistic regression is a classification formula that assign the observations to a separate set of classes. A number of the samples of classification issues are Email spam or not spam, on-line transactions Fraud or not Fraud, growth Malignant or Benign. logistical regression transforms its output victimisation the logistic sigmoid perform to come back a likelihood value.

Logistic regression is a ancient and classic applied mathematics model, that has been wide employed in the academy and industry. in contrast to linear regression, which is employed to create a prediction on the numeric response, supply regression is used to resolve a classification problem. For example, once an individual applies a loan from a bank, bank is fascinated by whether or not this mortal can default within the future? (default or not default).

How it works

Logistic Regression measures the connection between the variable quantity (our label, what we would like to predict) and therefore the one or a lot of freelance variables (our features), by estimating chances exploitation it’s underlying Sigmoid function.

These probabilities should then be remodeled into binary values so as to really build a prediction. This can be the task of the logistic function, also known as the sigmoid function. The Sigmoid-Function is an formed curve which will take any real-valued range and map it into a worth between the vary of zero and one, however it is never specifically at those limits. This values between 0 and 1 will then be remodeled into either zero or one employing a threshold classifier.

The picture below illustrates the steps that logistic regression goes through to give you your desired output.

Below you can see how the logistic function (sigmoid function) looks like:

We want to maximize the chance that a random information gets classified correctly, that is termed most likelihood Estimation. Maximum Likelihood Estimation could be a general approach to estimating parameters in applied mathematics models. we’ll be able to maximize the likelihood mistreatment totally different strategies like an improvement algorithmic program. Newton’s technique is such an algorithm and might be accustomed notice maximum (or minimum) of the many different functions, as well as the likelihood function. rather than Newton’s Method, you may conjointly use Gradient Descent.

When to use it

Like I already mentioned, logistic Regression separates your input into 2 category by a linear boundary, one for every class. thus it’s needed that you simply knowledge is linearly separable, just like the data points within the image below:

In alternative words: you must have confidence victimisation logistic regression once your Y variable takes on solely two values (e.g once you face a classification problem). we can use logistic regression in this below following cases:-

  1. Credit scoring
  2. Hotel Booking
  3. Gaming

--

--