Logistic Regression by Nirzona
Logistic Regression by Nirzona
LOGISTIC REGRESSION
???
3
LOGISTIC REGRESSION
On the basis of the categories, Logistic Regression can be classified into three types:
1. Binomial: In binomial Logistic regression, there can be only two possible types of the
dependent variables, such as 0 or 1, Pass or Fail, etc.
2. Multinomial: In multinomial Logistic regression, there can be 3 or more possible
unordered types of the dependent variable, such as “cat”, “dogs”, or “sheep”
3. Ordinal: In ordinal Logistic regression, there can be 3 or more possible ordered types
of dependent variables, such as “low”, “Medium”, or “High”.
6
why use logistic Regression
Linear regression and logistic regression are machine learning techniques that make
predictions by analyzing historical data. Linear regression techniques
mathematically model the unknown factor on multiple known factors to estimate the
exact unknown value. Similarly, logistic regression uses mathematics to find the
relationships between two data factors. It then uses this relationship to predict the
value of one of those factors based on the other. The prediction usually has a finite
number of outcomes, like yes or no.
Logistic regression models can help teams identify data anomalies, which are
predictive of fraud.
How does Logistic Regression 7
work?
The logistic regression model transforms the linear regression function continuous value
output into categorical value output using a sigmoid function, which maps any real-valued set
of independent variables input into a value between 0 and 1. This function is known as the
logistic function.
Let the independent input features be:
x11 ........ x1m
X= x21 ….. X2m
….. …… …….
0 IF CLASS 1
Y= 1 IF CLASS 2
We can evaluate the logistic regression model using the following metrics:
Confusion Matrix: This matrix shows the true positives, true negatives, false positives, and
false negatives. It helps in understanding the model's classification performance.
Accuracy: The proportion of correctly classified instances out of the total instances. It’s a
common metric but can be misleading if the dataset is imbalanced.
Precision: The ratio of true positives to the sum of true and false positives. It measures how
many predicted positives are actually positive.
Recall (Sensitivity): The ratio of true positives to the sum of true positives and false negatives.
It measures how many actual positives the model captures.
F1-Score: The harmonic mean of precision and recall, useful when you want a balance
between the two.
11
Thank You