Logistic Regression
- A supervised classification technique that models the conditional probability of an observation belonging to a certain class.
- Logistic regression is used in various fields like social sciences, medicine, and engineering.
- Relationship between two variables is linear.
- Logistic function, too large and too small values
.
Logistic Regression Formula
The logistic regression model is used to model the probability of a binary outcome. The formula for the logistic regression model is:
Where:
is the probability that the dependent variable equals given the independent variables . is the intercept. are the coefficients of the independent variables
The logit function (log-odds) is given by:
Where:
is the natural logarithm of the odds of .
Likelihood and Log-Likelihood Functions for Logistic Regression
Likelihood Function
- The likelihood function estimates model parameters based on observed data.
- It is applicable when modeling binary outcomes in logistic regression.
- The likelihood function for logistic regression, given a set of
observations, is:
Where:
is the observed value of the dependent variable for the -th observation. is the vector of independent variables for the -th observation. represents the vector of coefficients.
Log-Likelihood Function
- Log transformation simplifies product calculations to sum calculations.
- Maximum Likelihood Estimation technique is used in logistic regression for fitting.
- The log-likelihood function is the natural logarithm of the likelihood function. It is given by:
Where:
is the observed value of the dependent variable for the -th observation. is the vector of independent variables for the -th observation. represents the vector of coefficients.
Maximum Likelihood Estimation (MLE)
Estimation technique used to estimate parameters or coefficients for many machine learning models (

Steps:
- Define Likelihood Function.
- Write Log-like Function.
- Find Maximum of Log-like Function.
- Estimate the Parameters.
- Check model Fit.
- Make Predictions and Evaluate.
Pros
- Simple Model.
- Low Variance.
- Low Bias.
- Provides Probability.
Cons
- Unable to model non-linear relationship.
- Unstable when classes are well separable.
- Unstable when there are more than 2 classes.