Generative and Discriminative Models

Introduction

In machine learning, there are two broad categories of models: generative models and discriminative models. In this blog post, we will discuss some popular examples of each and their capabilities.

Generative Models

  1. Naive Bayes Classifier
  2. Hidden Markov Models
  3. Latent Dirichlet Allocation
  4. Boltzmann Machine
  5. Gaussian Mixture Model ( Unsupervised clustering)

Generative Models Explanation

Generative models allow us to generate datasets for specific classes, labels, or clusters. They estimate the joint probability distribution P(X, y). An example of this is the Naive Bayes Classifier, where we have a probability associated with each (X, y) pair. For classification, we predict y based on the highest probability given x.

π‘Žπ‘Ÿπ‘”π‘šπ‘Žπ‘₯𝑦𝑃(π‘Œ=𝑦|𝑋=π‘₯)=
π‘Žπ‘Ÿπ‘”π‘šπ‘Žπ‘₯𝑦𝑃(π‘Œ=𝑦,𝑋=π‘₯)/𝑃(𝑋=π‘₯) = π‘Žπ‘Ÿπ‘”π‘šπ‘Žπ‘₯𝑦𝑃(π‘Œ=𝑦,𝑋=π‘₯)/𝑃(𝑋=π‘₯)

Generative models offer more than just prediction. They can be used to:

  • Impute missing data
  • Compress datasets
  • Generate unseen data

Discriminative Models

  1. Logistic Regression
  2. Support Vector Machines
  3. Decision Trees

Discriminative Models Explanation

Discriminative models focus on learning the boundaries that separate different classes directly. They do not model the entire joint probability distribution but instead estimate the conditional probability P(y|x). Examples of discriminative models include Logistic Regression, Support Vector Machines, and Decision Trees.