Docsity

PROBABILISTIC MACHINE LEARNING CERTIFICATION EVALUATION SOLVED QUESTIONS WITH VERIFIED ANS, Exams of Advanced Algorithms

Toggle sidebar
bg1
PROBABILISTIC MACHINE LEARNING
CERTIFICATION EVALUATION SOLVED
QUESTIONS WITH VERIFIED ANSWER KEY
●● intuition behind a GMM
Answer: Instead of saying "the data comes from one normal
distribution," a GMM says:
- The data comes from several overlapping normal distributions, and
each point was generated by one of them (but we don't know which
one).
Each Gaussian has:
- Its own mean
- Its own variance/covariance
- A mixing weight (how common that component is)
***So the overall distribution is a weighted sum of Gaussians.
●● why is a GMM useful
Answer: - Clustering (soft clustering — points belong to clusters with
probabilities)
- Density estimation
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a

Partial preview of the text

Download PROBABILISTIC MACHINE LEARNING CERTIFICATION EVALUATION SOLVED QUESTIONS WITH VERIFIED ANS and more Exams Advanced Algorithms in PDF only on Docsity!

PROBABILISTIC MACHINE LEARNING

CERTIFICATION EVALUATION SOLVED

QUESTIONS WITH VERIFIED ANSWER KEY

●● intuition behind a GMM Answer: Instead of saying "the data comes from one normal distribution," a GMM says:

  • The data comes from several overlapping normal distributions, and each point was generated by one of them (but we don't know which one). Each Gaussian has:
  • Its own mean
  • Its own variance/covariance
  • A mixing weight (how common that component is) ***So the overall distribution is a weighted sum of Gaussians. ●● why is a GMM useful Answer: - Clustering (soft clustering — points belong to clusters with probabilities)
  • Density estimation
  • Modeling multimodal data ●● difference between GMM and k-means Answer: k-means: Hard cluster assignment GMM: Probabilistic, allows overlapping clusters ●● can you give an example of a GMM in practice: test scores Answer: - Suppose you look at standardized test scores from a large region and notice the distribution has two peaks. Instead of assuming one normal distribution, you model it as:
  • Gaussian 1: Students who did not prepare much Lower mean score
  • Gaussian 2: Students who took intensive prep Higher mean score A GMM would:
  1. Estimate the mean and variance of each group
  2. Estimate the proportion of students in each group
  3. Assign each student a probability of belonging to each group So instead of saying:

Answer: The Expectation-Maximization (EM) algorithm is an iterative method for estimating model parameters when your data has hidden (latent) variables. It's commonly used for models like Gaussian Mixture Models, where we don't know which cluster generated each data point. ●● what is the EM alg doing Answer: When some variables are missing or unobserved, we alternate between: E-step (Expectation step)

  • Compute the expected value of the hidden variables
  • In GMM: compute the probability that each point belongs to each Gaussian M-step (Maximization step)
  • Update the model parameters to maximize the expected likelihood
  • In GMM: update means, covariances, and mixing weights using the soft assignments (70% chance of being in cluster 1, etc.) ***Each iteration increases (or keeps constant) the likelihood.

●● what is the posterior distribution Answer: The posterior distribution is the probability of the hidden (latent) variable given the observed data. In the context of Gaussian Mixture Models (GMMs) and EM, it tells us:

  • "Given the observed data point x_i, what is the probability it was generated by component k?" ●● what is the posterior distribution and where does it apply in the em alg Answer: Where it applies in EM
  1. E-step (Expectation step):
  • This is exactly where the posterior is computed.
  • For each data point x_i and component k: γik\gamma_{ik}γik is called the responsibility, i.e., the posterior probability that point i belongs to component k.
  1. M-step (Maximization step):
  • These posterior probabilities are then used as weights to update the parameters (means, covariances, and mixing weights). ●● bayes rule equation Answer: P(A|B) = P(B|A)P(A) / P(B)

Answer: Because probabilities must sum (or integrate) to 1, we divide by the marginal probability of the data (sometimes called the normalization constant). This marginal distribution ensures the posterior is a proper probability distribution. in P(A|B) = P(B|A)P(A) / P(B), it is P(B) ●● what is the joint distribution and where does it apply to bayes Answer: So Bayes' Rule is really just expressing the posterior as the joint probability divided by the marginal: in P(A|B) = P(B|A)P(A) / P(B), the joint probability is really just the entire numerator

  • The joint distribution tells us how likely a hypothesis and the data occur together. ●● conditional probability and joint probability in bayes Answer: - The joint distribution tells us how likely a hypothesis and the data occur together.
  • Bayes' Rule converts that into a conditional probability, telling us: given the data, how likely is the hypothesis? ●● what is bayes rule telling us intuitively Answer: Bayes' Rule is really telling us how to update our beliefs in light of new evidence.
  1. It tells you how to go from what you believed before seeing the data (the prior)
  2. ...to what you should believe after seeing the data (the posterior),
  3. ...by taking into account how likely the data is under each hypothesis (the likelihood) 4)....and normalizing so probabilities sum to 1 (using the marginal probability of the data). ●● when to use gmm (em) and when to use k-means for clustering Answer: 1️⃣ K-means
  • Hard clustering: each point is assigned to exactly one cluster.
  • Assumes clusters are spherical (circular) and equally sized.
  • Measures distance using Euclidean distance.

Answer: A Bayes classifier is a probabilistic classification method that assigns a class label to a data point by choosing the class with the highest posterior probability given the observed features, according to Bayes' Rule. ●● intuition behind bayes classifier Answer: 1. for each class, compute posterior probability in P(A|B) = P(B|A)P(A) / P(B) where: P(A): prior probability of class A P(B|A): likelihood of the features B given the class A P(B): marginal probability of the data B

  1. Assign the data point to the class with the largest posterior probability "Given what I knew before (prior) and what I see now (likelihood), what is the probability this belongs to each class (posterior)? Pick the most probable." ●● what are the pros of a bayes classifier Answer: 1️⃣ Probabilistic output
  • It gives posterior probabilities for each class, not just a label (e.g., flag emails with 60% probability as "maybe spam")

Optimal under correct assumptions

  • If the true distributions are known, the Bayes classifier minimizes the expected classification error. Handles small data efficiently
  • With proper priors, it can still work reasonably well even with limited training data. Simple and fast
  • Computing posterior probabilities is straightforward, especially in Naive Bayes, which assumes conditional independence of features.
  • Very scalable to large datasets. Flexible
  • Can incorporate prior knowledge naturally.
  • Works for continuous and discrete features.
  • Can be extended to mixture models, like GMMs, for more complex distributions. ●● what are the cons of a bayes classifier Answer: 1️⃣ Assumptions about feature distributions

●● what are generative models? Answer: 1️⃣ Generative Models → Use the Joint Probability P(X,Y)

  • Generative models try to understand how the data is generated.
  • They model the joint distribution of features and labels: P(X,Y) = P(Y) ⋅ P(X ∣ Y) Interpretation: P(Y)= how likely each class is (prior) P(X∣Y) = how likely the features are for that class (likelihood) Prediction:
  • To classify a new data point, use Bayes' Rule:
  • So even though the ultimate goal is the posterior prob, generative models go through the joint probability first. ●● what are examples of generative models? Answer: - Naive Bayes
  • Gaussian Mixture Models (GMMs)
  • Hidden Markov Models

●● pros of generative models Answer: - Can generate new data from the learned distribution.

  • Useful when you want uncertainty estimates (posterior probabilities).
  • Can work with missing data using EM. ●● cons of generative models Answer: - Often make strong assumptions about the data (e.g., feature independence).
  • Can be less accurate for classification if the assumptions are wrong. ●● pros and cons of discriminative models Answer: Pros / When to use:
  • Often more accurate for classification when you don't care about the underlying data distribution.
  • No strong assumptions about feature distributions. Cons:
  • Cannot generate new data samples easily.
  • May not handle missing data naturally. ●● examples of discriminative models Answer: Logistic Regression Support Vector Machines (SVMs)

Discriminative approach:

  • Learn directly the boundary between apples and oranges in color-size space P(Y∣X)
  • Don't model the detailed distribution of color and size within each fruit ●● what is linear discriminant analysis LDA (dimension reduction) Answer: - dimension reduction technique that focuses on maximizing the seperatability among known categories ●● intuition behind LDA Answer: 1. "Let me learn the cloud of points for each class."
  1. "Now I'll see where those clouds overlap."
  2. "The optimal separating surface between those Gaussian clouds is linear." ●● how does LDA create a new dimension Answer: 1) maximize the distance between the means
  1. minimize the variation (which LDA calls scatter) within each category ●● similarities between PCA and LDA Answer: - both rank the new axes in order of importance
  • PC1 accounts for the most variation in the data WHILE LD1 accounts for the most variation between the categories ●● when to use lda and when to use pca Answer: Use PCA when:
  • You want dimensionality reduction
  • You don't have labels
  • You want to visualize high-dimensional data
  • You want to compress data
  • You want to remove noise Use LDA when:
  • You have labels
  • Your goal is classification
  • You want to reduce dimensions while preserving class separation ●● differences between lda and pca Answer: PCA (Principal Component Analysis) → Unsupervised → Ignores class labels → Finds directions of maximum variance LDA (Linear Discriminant Analysis)

Answer: All four methods:

  • Estimate prior P(Y)
  • Make assumptions about the likelihood P(X | Y)
  • Use Bayes' rule P(Y | X) = P(Y) P(X|Y) / P(X)
  • Pick the largest posterior They just differ in how they model P(X∣Y) (the likelihood) ●● difference between the four big bayes classifiers Answer: 1️⃣ Naive Bayes Assumes:
  • Features are conditionally independent
  • Very simple structure. Gaussian Naive Bayes Assumes:
  • Features are independent
  • Each feature is Gaussian
  • So it's just a special case of Naive Bayes. LDA Assumes:
  • Multivariate Gaussian per class
  • Features can be correlated
  • Same covariance matrix for all classes
  • More flexible than Gaussian NB. QDA Assumes:
  • Multivariate Gaussian per class
  • Features can be correlated
  • Each class has its own covariance matrix
  • Most flexible of the four. ●● comparison of LDA, QDA and naive bayes in regards to computation Answer: Naive Bayes (Gaussian NB):
  • Assumes features are independent within each class → covariance matrix is diagonal.
  • You only need to compute the variance of each feature per class, not the off-diagonal terms.
  • If you have d features → only d numbers per class. LDA: