Logistic Regression

Aswini kumar
3 min readNov 5, 2022

--

Logistic Regression is the concept of the predictive modelling as regression , therefore , it is called logistic regression , but is used to classify samples , therefore is comes under the classification algorithm.

It is the basic representation of the logistic function , as it is the classification model where the output lies between (0 and 1).

Cost Function for Logistic Regression

For the Logistic Regression the cost function is

Log Loss Cost Function

if y = 1

so

To fit the parameter , J(0) has to be minimized .

Performance Metrics

  1. Confusion Matrix :

Confusion Matrix is basically the performance measurement of the machine learning classification problem , where the output can be two or more classes.

Confusion Matrix

True positive (TP) :

Interpretation : Prediction is Positive and it true

True Negative(TN):

Interpretation: Prediction is negative and it’s true.

False Positive (FP)

Interpretation: Prediction is Positive and it false.

False Negative(FN)

Interpretation :Prediction is negative and it false

2.Accuracy :

Accuracy = TP +TN\TP+TN+FP+FN

3.Recall :

Out of all the predicted value how many are correctly predicated.

4.Precision :

Out of all the actual value ,how many are correctly predicated

5.F-Measure:

F-score helps to measure the recall and precision at the same time .It use harmonic mean in place of arithmetic mean by publishing the extreme value more.

Application of Logistic Regression :

The data of logistic regression is either the binary or multinomial or ordinal.

Such kind use case of these data are fraud detection data , loan defaulter , attrition of employee , infected with covid-19 or not and many more.

--

--

Responses (1)