How are you arriving the expression for Likelihood Function for a Single Observation?
The expression for the likelihood function of a single observation is derived based on the following reasoning:
1. Understanding the Logistic Function:
- In logistic regression, we model the probability that a binary outcome equals 1 (i.e., the event happens) using the logistic function:
- Where , with being the weight vector and the feature vector for the -th observation.
2. Probability of Class 1 and Class 0:
- The probability that (the event happens) given the input features is:
- The probability that (the event does not happen) is:
3. Likelihood Function for a Single Observation:
- The likelihood for a single observation is the probability of observing given the input and model parameters . Since can be either 0 or 1, we can combine the two cases into a single expression using the following formulation:
4. Explanation of the Formula:
When :
- The expression simplifies to:
- This is because makes the first term become and the second term becomes 1.
When :
- The expression simplifies to:
- This is because makes the first term become 1 (since anything raised to the power of 0 is 1) and the second term becomes .
5. General Case:
- By combining both cases (i.e., whether is 0 or 1) into a single expression, we arrive at the following likelihood function for a single observation:
- This expression allows us to compute the probability of observing the outcome given the input features and the model's parameters, regardless of whether is 0 or 1.
Summary:
The key idea is that this formulation captures both possible outcomes for in a single expression, by raising the probability to the power of . This way, when is 1, the first term dominates, and when is 0, the second term dominates, effectively covering both scenarios.
Reference
Python Machine Learning Sebastian Raschka Packt Publishing (2015)
Wednesday, August 14, 2024
Likelihood of a Single Observation For Logistic Regression Model
To See All ML Articles: Index of Machine Learning
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment