CS 7641 ML Practice Midterm Exam |
Questions and Answers | 2026 Update |
100% Correct - GT.
Practice Question Bank & Answer Rationale
THIS PACK CONTAINS
137 exam-style multiple-choice questions. Each question includes the correct answer and a complete
rationale for focused revision.
COVERAGE
Covers supervised learning (decision trees, regression, neural networks, instance-based, Bayesian,
ensembles, SVMs), unsupervised learning (clustering, dimensionality reduction, matrix factorization), Markov
decision processes and reinforcement learning, and the theory of generalization, bias-variance, and
computational learning. Emphasizes mathematical derivation, algorithmic reasoning, and empirical diagnosis
of learner behavior.
STUDY GUIDE
Recommended duration: 3 hours. Passing target: 70% (with A+ threshold at 95%+).
HIGHP - Page 1 of 48
,1. A decision tree is fully grown on a training set with zero label noise until every leaf is
pure. If we then apply reduced-error pruning using a large independent validation set,
which quantity is most likely to increase?
[ ] A. Training accuracy
[ ] B. Model variance across resampled training sets
[ ] C. Validation accuracy
[ ] D. Number of internal nodes
CORRECT: C. Validation accuracy
Reduced-error pruning removes subtrees that do not improve held-out performance, trading training fit for
generalization and thus typically raising validation accuracy. Training accuracy falls (not rises), variance
decreases with a smaller tree, and internal-node count shrinks-so A, B, and D move in the wrong direction.
2. In k-means with k fixed, you observe that the objective (sum of squared distances to
centroids) decreases monotonically but the algorithm converges to visibly different
partitions across random initializations. Which statement best characterizes this
behavior?
[ ] A. The objective is convex in the assignments, so any local optimum is global.
[ ] B. Lloyd's algorithm is an EM variant whose M-step is exact, guaranteeing the global optimum.
[ ] C. The objective is non-convex; Lloyd's iterations monotonically decrease a bound that has multiple
local minima.
[ ] D. Divergence across runs indicates a coding error, since k-means is deterministic.
CORRECT: C. The objective is non-convex; Lloyd's iterations monotonically decrease a bound that
has multiple local minima.
Lloyd's algorithm performs coordinate descent on a non-convex objective, so each iteration decreases the
(assignment-conditioned) loss but can settle in different local minima depending on initialization. The
objective is not jointly convex, and the algorithm is not globally optimal, ruling out A and B; D is false because
random initialization legitimately changes the basin of attraction.
3. You train a linear SVM with slack variables. Increasing the penalty parameter C by a
factor of 100 while keeping the kernel fixed will most directly:
[ ] A. Widen the margin and increase the number of support vectors.
[ ] B. Narrow the margin and reduce tolerance for margin violations.
[ ] C. Leave the margin unchanged but increase the kernel bandwidth.
[ ] D. Convert the soft-margin problem into a hard-margin problem with identical solutions.
CORRECT: B. Narrow the margin and reduce tolerance for margin violations.
C controls the trade-off between margin width and slack penalties; larger C penalizes violations more heavily,
shrinking the margin and typically reducing support-vector count. It does not alter the kernel (C), does not
necessarily produce the hard-margin solution unless data are separable (D), and does not widen the margin
HIGHP - Page 2 of 48
, (A).
4. A Gaussian Bayes classifier assumes features are conditionally independent given the
class. If two highly correlated features are both included, the practical consequence is
most often:
[ ] A. Overconfident posterior probabilities and degraded ranking, despite possibly unchanged argmax
decisions.
[ ] B. Guaranteed lower training error because more features are available.
[ ] C. The model reduces to logistic regression in the limit of infinite data.
[ ] D. The decision boundary becomes non-linear regardless of covariance assumptions.
CORRECT: A. Overconfident posterior probabilities and degraded ranking, despite possibly
unchanged argmax decisions.
Violating conditional independence double-counts evidence, inflating posterior confidence and harming
probability calibration even when the argmax label is unchanged. More features do not guarantee lower error
(B); naive Bayes does not converge to logistic regression (C); and with shared covariance the boundary
remains linear (D).
5. In a Markov decision process with discount factor gamma in [0,1), value iteration is
guaranteed to converge to the optimal value function because the Bellman optimality
operator is:
[ ] A. A non-expansive contraction in the sup-norm with modulus gamma.
[ ] B. Monotone but not a contraction, so convergence depends on initialization.
[ ] C. A linear operator whose eigenvalues all equal gamma.
[ ] D. Averaging operator that converges only when gamma equals 1.
CORRECT: A. A non-expansive contraction in the sup-norm with modulus gamma.
The Bellman optimality backup is a gamma-contraction in the infinity norm, so Banach's fixed-point theorem
guarantees a unique fixed point and geometric convergence independent of initialization. It is not merely
monotone (B), not linear due to the max (C), and gamma=1 removes the contraction guarantee (D).
6. You apply PCA to centered data and retain the top two components, which explain 55%
of total variance. A colleague claims this projection is optimal for reconstruction under
squared error. Which condition is essential for that claim to hold?
[ ] A. The data must be Gaussian.
[ ] B. The retained components must be orthogonal and derived from the sample covariance
eigenvectors.
[ ] C. The features must be standardized to unit variance.
[ ] D. The number of samples must exceed the number of features.
HIGHP - Page 3 of 48
, CORRECT: B. The retained components must be orthogonal and derived from the sample covariance
eigenvectors.
PCA's optimality for squared-error reconstruction follows from projecting onto the leading eigenvectors of the
covariance matrix, which are orthogonal. Gaussianity (A) is unnecessary, standardization (C) changes the
problem and is not required for the theorem, and n > d (D) is not needed for the reconstruction guarantee.
7. A random forest and a single fully grown decision tree achieve identical training
accuracy. On a noisy validation set, the forest typically generalizes better primarily
because:
[ ] A. Bagging reduces bias by fitting deeper trees.
[ ] B. Averaging decorrelated trees reduces variance without materially increasing bias.
[ ] C. Random feature subsampling increases the strength of individual trees.
[ ] D. Out-of-bag error is used as the splitting criterion.
CORRECT: B. Averaging decorrelated trees reduces variance without materially increasing bias.
Ensembling decorrelated high-variance trees averages away variance while preserving low bias, improving
test performance. Bagging does not reduce bias (A); feature subsampling weakens individual trees to
decorrelate them (C); and OOB error is used for estimation, not splitting (D).
8. During 10-fold cross-validation you tune hyperparameters on the full dataset and report
the best fold's accuracy as the model's expected performance. This protocol is flawed
mainly because:
[ ] A. Ten folds provide too few samples for reliable estimation.
[ ] B. Hyperparameter selection leaks validation information, biasing the estimate optimistically.
[ ] C. Cross-validation assumes i.i.d. data, which never holds in practice.
[ ] D. The best fold's accuracy has higher variance but is unbiased.
CORRECT: B. Hyperparameter selection leaks validation information, biasing the estimate
optimistically.
Selecting hyperparameters using the same folds used for evaluation leaks information, producing an
optimistically biased estimate; nested cross-validation is needed. Fold count (A) is not the core issue, i.i.d.
violations (C) are a separate concern, and the estimate is biased, not merely high-variance (D).
9. In Q-learning with a function approximator, the update uses a target that depends on
the current network's parameters. This most directly causes:
[ ] A. Guaranteed convergence to the optimal Q-function under linear approximation.
[ ] B. A moving-target instability that can produce divergence or oscillation.
[ ] C. Elimination of the exploration-exploitation trade-off.
[ ] D. Exact equivalence to policy iteration.
HIGHP - Page 4 of 48
Questions and Answers | 2026 Update |
100% Correct - GT.
Practice Question Bank & Answer Rationale
THIS PACK CONTAINS
137 exam-style multiple-choice questions. Each question includes the correct answer and a complete
rationale for focused revision.
COVERAGE
Covers supervised learning (decision trees, regression, neural networks, instance-based, Bayesian,
ensembles, SVMs), unsupervised learning (clustering, dimensionality reduction, matrix factorization), Markov
decision processes and reinforcement learning, and the theory of generalization, bias-variance, and
computational learning. Emphasizes mathematical derivation, algorithmic reasoning, and empirical diagnosis
of learner behavior.
STUDY GUIDE
Recommended duration: 3 hours. Passing target: 70% (with A+ threshold at 95%+).
HIGHP - Page 1 of 48
,1. A decision tree is fully grown on a training set with zero label noise until every leaf is
pure. If we then apply reduced-error pruning using a large independent validation set,
which quantity is most likely to increase?
[ ] A. Training accuracy
[ ] B. Model variance across resampled training sets
[ ] C. Validation accuracy
[ ] D. Number of internal nodes
CORRECT: C. Validation accuracy
Reduced-error pruning removes subtrees that do not improve held-out performance, trading training fit for
generalization and thus typically raising validation accuracy. Training accuracy falls (not rises), variance
decreases with a smaller tree, and internal-node count shrinks-so A, B, and D move in the wrong direction.
2. In k-means with k fixed, you observe that the objective (sum of squared distances to
centroids) decreases monotonically but the algorithm converges to visibly different
partitions across random initializations. Which statement best characterizes this
behavior?
[ ] A. The objective is convex in the assignments, so any local optimum is global.
[ ] B. Lloyd's algorithm is an EM variant whose M-step is exact, guaranteeing the global optimum.
[ ] C. The objective is non-convex; Lloyd's iterations monotonically decrease a bound that has multiple
local minima.
[ ] D. Divergence across runs indicates a coding error, since k-means is deterministic.
CORRECT: C. The objective is non-convex; Lloyd's iterations monotonically decrease a bound that
has multiple local minima.
Lloyd's algorithm performs coordinate descent on a non-convex objective, so each iteration decreases the
(assignment-conditioned) loss but can settle in different local minima depending on initialization. The
objective is not jointly convex, and the algorithm is not globally optimal, ruling out A and B; D is false because
random initialization legitimately changes the basin of attraction.
3. You train a linear SVM with slack variables. Increasing the penalty parameter C by a
factor of 100 while keeping the kernel fixed will most directly:
[ ] A. Widen the margin and increase the number of support vectors.
[ ] B. Narrow the margin and reduce tolerance for margin violations.
[ ] C. Leave the margin unchanged but increase the kernel bandwidth.
[ ] D. Convert the soft-margin problem into a hard-margin problem with identical solutions.
CORRECT: B. Narrow the margin and reduce tolerance for margin violations.
C controls the trade-off between margin width and slack penalties; larger C penalizes violations more heavily,
shrinking the margin and typically reducing support-vector count. It does not alter the kernel (C), does not
necessarily produce the hard-margin solution unless data are separable (D), and does not widen the margin
HIGHP - Page 2 of 48
, (A).
4. A Gaussian Bayes classifier assumes features are conditionally independent given the
class. If two highly correlated features are both included, the practical consequence is
most often:
[ ] A. Overconfident posterior probabilities and degraded ranking, despite possibly unchanged argmax
decisions.
[ ] B. Guaranteed lower training error because more features are available.
[ ] C. The model reduces to logistic regression in the limit of infinite data.
[ ] D. The decision boundary becomes non-linear regardless of covariance assumptions.
CORRECT: A. Overconfident posterior probabilities and degraded ranking, despite possibly
unchanged argmax decisions.
Violating conditional independence double-counts evidence, inflating posterior confidence and harming
probability calibration even when the argmax label is unchanged. More features do not guarantee lower error
(B); naive Bayes does not converge to logistic regression (C); and with shared covariance the boundary
remains linear (D).
5. In a Markov decision process with discount factor gamma in [0,1), value iteration is
guaranteed to converge to the optimal value function because the Bellman optimality
operator is:
[ ] A. A non-expansive contraction in the sup-norm with modulus gamma.
[ ] B. Monotone but not a contraction, so convergence depends on initialization.
[ ] C. A linear operator whose eigenvalues all equal gamma.
[ ] D. Averaging operator that converges only when gamma equals 1.
CORRECT: A. A non-expansive contraction in the sup-norm with modulus gamma.
The Bellman optimality backup is a gamma-contraction in the infinity norm, so Banach's fixed-point theorem
guarantees a unique fixed point and geometric convergence independent of initialization. It is not merely
monotone (B), not linear due to the max (C), and gamma=1 removes the contraction guarantee (D).
6. You apply PCA to centered data and retain the top two components, which explain 55%
of total variance. A colleague claims this projection is optimal for reconstruction under
squared error. Which condition is essential for that claim to hold?
[ ] A. The data must be Gaussian.
[ ] B. The retained components must be orthogonal and derived from the sample covariance
eigenvectors.
[ ] C. The features must be standardized to unit variance.
[ ] D. The number of samples must exceed the number of features.
HIGHP - Page 3 of 48
, CORRECT: B. The retained components must be orthogonal and derived from the sample covariance
eigenvectors.
PCA's optimality for squared-error reconstruction follows from projecting onto the leading eigenvectors of the
covariance matrix, which are orthogonal. Gaussianity (A) is unnecessary, standardization (C) changes the
problem and is not required for the theorem, and n > d (D) is not needed for the reconstruction guarantee.
7. A random forest and a single fully grown decision tree achieve identical training
accuracy. On a noisy validation set, the forest typically generalizes better primarily
because:
[ ] A. Bagging reduces bias by fitting deeper trees.
[ ] B. Averaging decorrelated trees reduces variance without materially increasing bias.
[ ] C. Random feature subsampling increases the strength of individual trees.
[ ] D. Out-of-bag error is used as the splitting criterion.
CORRECT: B. Averaging decorrelated trees reduces variance without materially increasing bias.
Ensembling decorrelated high-variance trees averages away variance while preserving low bias, improving
test performance. Bagging does not reduce bias (A); feature subsampling weakens individual trees to
decorrelate them (C); and OOB error is used for estimation, not splitting (D).
8. During 10-fold cross-validation you tune hyperparameters on the full dataset and report
the best fold's accuracy as the model's expected performance. This protocol is flawed
mainly because:
[ ] A. Ten folds provide too few samples for reliable estimation.
[ ] B. Hyperparameter selection leaks validation information, biasing the estimate optimistically.
[ ] C. Cross-validation assumes i.i.d. data, which never holds in practice.
[ ] D. The best fold's accuracy has higher variance but is unbiased.
CORRECT: B. Hyperparameter selection leaks validation information, biasing the estimate
optimistically.
Selecting hyperparameters using the same folds used for evaluation leaks information, producing an
optimistically biased estimate; nested cross-validation is needed. Fold count (A) is not the core issue, i.i.d.
violations (C) are a separate concern, and the estimate is biased, not merely high-variance (D).
9. In Q-learning with a function approximator, the update uses a target that depends on
the current network's parameters. This most directly causes:
[ ] A. Guaranteed convergence to the optimal Q-function under linear approximation.
[ ] B. A moving-target instability that can produce divergence or oscillation.
[ ] C. Elimination of the exploration-exploitation trade-off.
[ ] D. Exact equivalence to policy iteration.
HIGHP - Page 4 of 48