Probabilistic Generative Models
Generative models take a different approach to classification: they try to model how the data was generated for each class. Instead of just learning a boundary, they learn the distribution of the features for each class.
1. The MLE Landscape
In Maximum Likelihood Estimation (MLE), we can categorize algorithms based on how they model the likelihood :
- Discriminative : Directly models the mapping from inputs to outputs.
- Linear: Gaussian noise Linear Regression.
- Logistic: Bernoulli noise Logistic Regression.
- Generative : Models the joint probability. Both and are treated as random variables.
- Example: Naive Bayes.
2. The Generative Approach
A generative model learns:
- Class-Conditional Densities: (How does the data for class look?)
- Class Priors: (How common is class ?)
To classify a new point , we use Bayes' Theorem to find the posterior probability :
Dependent Events and Decomposition
For dependent events and , the joint probability is:
Generative ML assumes , while Discriminative ML assumes .
3. Gaussian Class Densities
In models like Gaussian Discriminant Analysis (GDA), we assume classes follow a Gaussian distribution.
Example: Drawing Samples If we have a class with distribution , most values will fall within the range (the high-density region).
Linear (LDA)
Assumes both classes share the same covariance. The resulting boundary is a straight line.
Quadratic (QDA)
Allows each class to have its own covariance. The resulting boundary is a curve.
- If all classes share the same covariance matrix , the decision boundary is linear (LDA).
- If classes have different covariance matrices , the decision boundary is quadratic (QDA).
Class-Conditional Densities
Generative models learn the distribution of each class independently, p(x | Ck). Bayes' rule is then used to compute the posterior p(Ck | x) for classification.
Comparison: Generative vs. Discriminative
| Feature | Generative Models (e.g., GDA, Naive Bayes) | Discriminative Models (e.g., Logistic Regression) |
|---|---|---|
| Assumption | ||
| Random Variables | Both and are random variables | is a random variable, is not |
| Alternative Notation | - | |
| Goal | Model | Model directly |
| New Samples | Can generate new data points from | Cannot generate new data |
Bayes Rule for Naive Bayes: For generative models, we often use to transform the classification problem.