Docsity

Bayesian Methods for Machine Learning: Practice Exam Questions, Exams of Technology

Toggle sidebar
bg1
Bayesian Methods for Machine Learning Certificate
Practice Exam
**Question 1.** Which of the following statements correctly describes the Kolmogorov axiom
of non‑negativity?
A) Probabilities can be negative if the event is rare.
B) All probabilities must be greater than or equal to zero.
C) Probabilities sum to one only for continuous variables.
D) Non‑negativity is optional for Bayesian models.
Answer: B
Explanation: The first Kolmogorov axiom requires that for any event A, P(A) ≥ 0.
**Question 2.** In a Bernoulli distribution, the parameter p represents:
A) The mean of the distribution.
B) The variance of the distribution.
C) The probability of success in a single trial.
D) The number of trials.
Answer: C
Explanation: A Bernoulli trial has two outcomes; p is the probability of the “success” outcome.
**Question 3.** The marginal probability P(X) can be obtained from the joint distribution P(X,Y)
by:
A) Dividing P(X,Y) by P(Y).
B) Integrating (or summing) P(X,Y) over all values of Y.
C) Multiplying P(X,Y) by P(Y).
D) Subtracting P(Y) from P(X,Y).
Answer: B
Explanation: Marginalization removes the unwanted variable by summing (discrete) or
integrating (continuous) over it.
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
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a

Partial preview of the text

Download Bayesian Methods for Machine Learning: Practice Exam Questions and more Exams Technology in PDF only on Docsity!

Practice Exam

Question 1. Which of the following statements correctly describes the Kolmogorov axiom of non‑negativity? A) Probabilities can be negative if the event is rare. B) All probabilities must be greater than or equal to zero. C) Probabilities sum to one only for continuous variables. D) Non‑negativity is optional for Bayesian models. Answer: B Explanation: The first Kolmogorov axiom requires that for any event A, P(A) ≥ 0. Question 2. In a Bernoulli distribution, the parameter p represents: A) The mean of the distribution. B) The variance of the distribution. C) The probability of success in a single trial. D) The number of trials. Answer: C Explanation: A Bernoulli trial has two outcomes; p is the probability of the “success” outcome. Question 3. The marginal probability P(X) can be obtained from the joint distribution P(X,Y) by: A) Dividing P(X,Y) by P(Y). B) Integrating (or summing) P(X,Y) over all values of Y. C) Multiplying P(X,Y) by P(Y). D) Subtracting P(Y) from P(X,Y). Answer: B Explanation: Marginalization removes the unwanted variable by summing (discrete) or integrating (continuous) over it.

Practice Exam

Question 4. Which conjugate prior pairs with a Poisson likelihood? A) Beta‑Binomial B) Gamma‑Poisson C) Normal‑Normal D) Dirichlet‑Multinomial Answer: B Explanation: The Gamma distribution is conjugate to the Poisson likelihood, yielding a Gamma posterior for the rate parameter. Question 5. The main difference between Maximum Likelihood Estimation (MLE) and Maximum A Posteriori (MAP) estimation is: A) MLE incorporates a prior, MAP does not. B) MAP maximizes the posterior, which includes the prior, while MLE maximizes only the likelihood. C) MLE always yields a closed‑form solution, MAP never does. D) MAP is only used for discrete parameters. Answer: B Explanation: MAP adds the log‑prior to the log‑likelihood, whereas MLE ignores the prior. Question 6. In Bayes’ theorem, the term “evidence” (or marginal likelihood) P(D) serves to: A) Normalize the posterior distribution. B) Represent the prior belief about parameters. C) Approximate the likelihood. D) Define the decision loss function. Answer: A

Practice Exam

C) Ignores the prior. D) Is always deterministic. Answer: B Explanation: Bayesian prediction integrates over the posterior over w, producing a distribution that reflects uncertainty. Question 10. In Bayesian logistic regression, the posterior is intractable because: A) The likelihood is not differentiable. B) The logistic function leads to a non‑conjugate likelihood with a Gaussian prior. C) The prior cannot be defined for binary outcomes. D) The data dimensionality is always too high. Answer: B Explanation: The logistic likelihood does not have a conjugate prior, so the posterior cannot be expressed in closed form. Question 11. Naïve Bayes assumes conditional independence between features given the class label. This assumption allows: A) Exact computation of the posterior without any approximations. B) Reduction of the joint likelihood to a product of marginal likelihoods. C) Use of any prior distribution without affecting the result. D) Modeling of feature interactions directly. Answer: B Explanation: Conditional independence lets us factor P(x₁,…,xₙ|y) = ∏ₖ P(x_k|y). Question 12. The Bayes factor comparing Model M₁ to Model M₂ is defined as: A) P(D|M₁) / P(D|M₂)

Practice Exam

B) P(M₁) / P(M₂)

C) P(θ₁|D) / P(θ₂|D) D) P(D) / (P(M₁)·P(M₂)) Answer: A Explanation: Bayes factor is the ratio of marginal likelihoods (evidence) for the two models. Question 13. Which information criterion explicitly approximates the leave‑one‑out predictive performance using the posterior? A) AIC B) BIC C) WAIC D) DIC Answer: C Explanation: WAIC (Widely Applicable Information Criterion) uses the posterior to approximate out‑of‑sample predictive accuracy. Question 14. In Metropolis‑Hastings MCMC, a proposed move is accepted with probability: A) min(1, p_new / p_old) B) max(0, p_new – p_old) C) p_new · p_old D) 1 / (1 + exp(‑ΔE)) Answer: A Explanation: Acceptance probability α = min(1, (π(θ') q(θ|θ')) / (π(θ) q(θ'|θ))) which reduces to min(1, p_new/p_old) for symmetric proposals. Question 15. Gibbs sampling is particularly useful when:

Practice Exam

Question 18. In variational inference, the Evidence Lower Bound (ELBO) is maximized because: A) It directly equals the marginal likelihood. B) Maximizing ELBO minimizes the KL divergence between the variational distribution and the true posterior. C) ELBO is always positive. D) It does not involve the prior. Answer: B Explanation: ELBO = log P(D) – KL(Q‖P); maximizing ELBO reduces KL divergence, bringing Q closer to the true posterior. Question 19. The mean‑field assumption in variational inference implies that: A) All latent variables are jointly Gaussian. B) The variational distribution factorizes over groups of variables, assuming independence. C) The posterior is multimodal. D) The prior must be conjugate. Answer: B Explanation: Mean‑field approximates Q(θ) = ∏ᵢ q_i(θ_i), treating components as independent for tractability. Question 20. Stochastic Variational Inference (SVI) is particularly advantageous for: A) Small datasets where exact inference is cheap. B) Large datasets where minibatch gradients can be used to scale ELBO optimization. C) Models without latent variables. D) Deterministic optimization problems. Answer: B

Practice Exam

Explanation: SVI uses stochastic gradients computed on minibatches, enabling variational inference on massive data. Question 21. The Laplace approximation approximates a posterior distribution by: A) A uniform distribution over the parameter space. B) A Gaussian centered at the MAP estimate, using the Hessian of the log‑posterior. C) A mixture of Dirichlet distributions. D) A Student‑t distribution with heavy tails. Answer: B Explanation: Laplace uses a second‑order Taylor expansion around the MAP to produce a Gaussian approximation. Question 22. In Expectation Propagation (EP), each factor of the posterior is approximated by: A) A deterministic point mass. B) A member of the exponential family that matches moments with the true factor. C) A non‑parametric kernel density. D) A Dirac delta function. Answer: B Explanation: EP iteratively refines approximations by matching moments (e.g., mean and variance) within the exponential family. Question 23. A Gaussian Process (GP) is fully specified by which two functions? A) Prior and posterior. B) Mean function m(x) and covariance (kernel) function k(x,x'). C) Likelihood and evidence. D) Activation and loss functions.

Practice Exam

Answer: B Explanation: Inducing points provide a low‑rank approximation, lowering the O(N³) cost to O(M³) with M ≪ N. Question 27. In a Bayesian Gaussian Mixture Model, the Dirichlet prior on the mixture weights serves to: A) Force all components to have equal weight. B) Encourage sparsity when its concentration parameter is small. C) Make the mixture model deterministic. D) Remove the need for an EM algorithm. Answer: B Explanation: A Dirichlet with concentration < 1 pushes weight mass onto fewer components, promoting sparsity. Question 28. The forward‑backward algorithm in a Bayesian Hidden Markov Model is used to: A) Sample from the posterior of the transition matrix. B) Compute the marginal posterior distribution of hidden states given observations. C) Optimize the emission probabilities. D) Perform dimensionality reduction. Answer: B Explanation: Forward‑backward efficiently calculates P(state_t | observations) for all t. Question 29. In Latent Dirichlet Allocation (LDA), each document’s topic proportions are drawn from: A) A Gaussian distribution. B) A Dirichlet distribution.

Practice Exam

C) A Bernoulli distribution. D) A Poisson distribution. Answer: B Explanation: LDA models per‑document topic mixtures with a Dirichlet prior. Question 30. Bayesian Optimization typically uses which surrogate model to approximate the objective function? A) Linear regression. B) Decision tree. C) Gaussian Process. D) K‑nearest neighbors. Answer: C Explanation: GPs provide a probabilistic model with uncertainty estimates needed for acquisition functions. Question 31. The Expected Improvement (EI) acquisition function balances exploration and exploitation by: A) Selecting points with the highest posterior mean only. B) Selecting points with the largest variance only. C) Computing the expected amount by which a new sample will improve over the current best. D) Randomly sampling points uniformly. Answer: C Explanation: EI integrates over the GP posterior to quantify expected gain, encouraging both high‑mean and high‑uncertainty points. Question 32. In Bayesian Neural Networks, placing a prior over each weight typically results in:

Practice Exam

Question 35. In decision theory, a loss function that penalizes squared error between the true parameter θ and an estimate (\hat{θ}) leads to the optimal Bayesian estimator being: A. The mode of the posterior. B. The median of the posterior. C. The mean of the posterior. D. Any random draw from the posterior. Answer: C Explanation: Minimizing expected squared loss yields the posterior mean as the Bayes estimator. Question 36. The term “Bayesian Occam’s razor” refers to: A. The tendency of Bayesian model evidence to favor simpler models that explain the data well. B. A prior that forces all parameters to be zero. C. The use of a uniform prior over all models. D. The removal of outliers before inference. Answer: A Explanation: Model evidence integrates over parameter space, automatically penalizing overly complex models that do not improve fit. Question 37. In a Bayesian setting, a 95 % credible interval for a parameter θ means: A. θ will fall in this interval in 95 % of repeated experiments. B. There is a 95 % probability that θ lies within the interval, given the data and prior. C. The interval contains 95 % of the prior mass. D. The interval is equivalent to a frequentist confidence interval. Answer: B Explanation: Credible intervals directly express posterior probability about parameter location.

Practice Exam

Question 38. Which of the following is a key advantage of using a conjugate prior? A. Guarantees a unique MAP estimate. B. Enables analytical updating of the posterior distribution. C. Prevents overfitting in all cases. D. Makes the prior independent of the likelihood. Answer: B Explanation: Conjugacy ensures the posterior belongs to the same family as the prior, allowing closed‑form updates. Question 39. In the context of Bayesian hierarchical models, hyper‑parameters are: A. Fixed constants that never change. B. Parameters of the prior distributions that themselves have priors. C. The observed data points. D. Always equal to zero. Answer: B Explanation: Hierarchical models place priors on prior parameters, creating another level of inference for hyper‑parameters. Question 40. For a Gaussian likelihood with known variance σ² and a Gaussian prior on the mean μ ~ N(μ₀, τ²), the posterior mean is a weighted average of: A. μ₀ only. B. The sample mean only. C. μ₀ and the sample mean, weighted by their precisions (1/variance). D. The median of the data. Answer: C

Practice Exam

Answer: B Explanation: Posterior predictive checks assess model fit by comparing simulated data to actual observations. Question 44. The No‑U‑Turn Sampler (NUTS) improves upon standard Hamiltonian Monte Carlo by: A. Automatically selecting the number of leapfrog steps to avoid redundant trajectories. B. Removing the need for a gradient. C. Using a uniform proposal distribution. D. Sampling only from the prior. Answer: A Explanation: NUTS adaptively decides when to stop a trajectory to avoid U‑turns, eliminating manual tuning of step counts. Question 45. In variational autoencoders (VAEs), the encoder network approximates: A. The exact posterior P(z|x). B. A variational distribution Q(z|x) to maximize the ELBO. C. The likelihood P(x|z) directly. D. The prior over latent variables. Answer: B Explanation: The encoder outputs parameters of Q(z|x), a tractable approximation to the true posterior, optimized via the ELBO. Question 46. Which kernel function would you choose to model data with known periodic behavior? A. Linear kernel. B. Periodic kernel.

Practice Exam

C. Rational quadratic kernel. D. White noise kernel. Answer: B Explanation: The periodic kernel explicitly encodes repeatable patterns with a defined period. Question 47. In Bayesian model averaging (BMA), predictions are obtained by: A. Selecting the single best model based on evidence. B. Averaging predictions across models weighted by their posterior model probabilities. C. Ignoring model uncertainty. D. Using the prior over models only. Answer: B Explanation: BMA integrates over model space, weighting each model’s predictive distribution by its posterior probability. Question 48. The concept of “temperature” in simulated annealing MCMC controls: A. The step size of the Hamiltonian dynamics. B. The acceptance probability, allowing exploration of low‑probability regions early on. C. The number of parallel chains. D. The dimensionality of the target distribution. Answer: B Explanation: Higher temperature flattens the target distribution, increasing acceptance of uphill moves to escape local modes. Question 49. In a Bayesian linear regression with an ARD (Automatic Relevance Determination) prior on weights, each weight w_i has its own variance hyper‑parameter α_i⁻¹. This prior encourages: A. All weights to be equal.

Practice Exam

A. Finite-dimensional vectors. B. Countably infinite mixture models, allowing the number of components to grow with data. C. Single scalar parameters. D. Deterministic functions. Answer: B Explanation: The DP defines a distribution over random probability measures, enabling infinite mixture modeling. Question 53. In Bayesian hypothesis testing, a Bayes factor greater than 10 is generally interpreted as: A. Strong evidence for the null hypothesis. B. Strong evidence for the alternative hypothesis. C. Inconclusive evidence. D. Evidence against both models. Answer: B Explanation: Conventional thresholds treat BF > 10 as strong support for the numerator model (alternative). Question 54. The term “posterior contraction” refers to: A. The posterior becoming more diffuse as data increase. B. The posterior concentrating around the true parameter value as sample size grows. C. The prior shrinking to a point mass. D. The evidence decreasing with more data. Answer: B Explanation: Asymptotically, the posterior mass concentrates near the true parameter, reflecting consistency.

Practice Exam

Question 55. In a Bayesian network, the likelihood of observed data can be computed efficiently by: A. Enumerating all possible joint assignments. B. Using variable elimination or belief propagation. C. Ignoring conditional independencies. D. Sampling from the prior only. Answer: B Explanation: Exact inference algorithms exploit the graph structure to sum out variables without full enumeration. Question 56. The “beta‑binomial” conjugate pair is used when modeling: A. Continuous outcomes with unknown variance. B. Counts of successes in a fixed number of trials with unknown success probability. C. Poisson counts with unknown rate. D. Multinomial outcomes with unknown class probabilities. Answer: B Explanation: Beta prior on success probability p, Binomial likelihood for number of successes; posterior is Beta. Question 57. In a Bayesian hierarchical linear regression, the group‑level coefficients are typically assigned: A. A deterministic constant. B. A common prior with hyper‑parameters that are themselves inferred. C. No prior at all. D. A uniform prior over all real numbers. Answer: B