S14 · Midterm exam
Midterm exam: fitting and generalization, likelihood and Bayes, decisions, information, Bayesian inference, regression and classification
Twelve problems from lessons 1 to 20: least squares and the gap between training and test error, generalization bounds, maximum likelihood and Bayes' theorem, decision boundaries and the Bayes error, entropy and cross-entropy, conjugate priors and Gaussian inference, ridge and Bayesian regression, Fisher's discriminant, logistic regression, generative classifiers, nearest neighbors and model evaluation. Give yourself two hours and work without the lessons open. "Another set" deals a different exam.
Check
Points (0, 1), (1, 2), (3, 9); separately, a correct model with 4 parameters fitted to 30 examples with noise variance 0.1.
(a)
Least-squares slope?
(b)
Expected test error?
(c)
Expected gap between test and training error?
Check
4 Gaussian samples whose maximum-likelihood variance is 2; and a log-likelihood with squared deviations summing to 60 at σ² = 2.
(a)
Unbiased variance?
(b)
Log-likelihood?
Check
Noise variance 0.01 with a weight prior of standard deviation 0.3; a false alarm costing 10 against a miss costing 500.
(a)
Equivalent regularization constant?
(b)
Posterior threshold for deciding positive?
Check
Gaussian classes with means 0 and 1, σ = 1.5, class 1's prior 0.8.
(a)
Minimum-error boundary?
(b)
Bayes error if the priors were equal?
Check
A binary event with probability 0.1, modeled as 0.2; a binary symmetric channel with flip probability 0.15.
(a)
Entropy of the event?
(b)
KL divergence in nats?
(c)
Channel mutual information with uniform input?
Check
A beta(1, 2) prior updated with 9 successes in 30 trials.
(a)
Posterior mean?
(b)
MAP?
(c)
Laplace's rule, ignoring this prior?
Check
Prior N(0, 0.5²) on a mean; 20 observations averaging 2 with noise variance 3.
(a)
Posterior variance?
(b)
Posterior mean?
Check
Zero-mean jointly Gaussian x, y with = 1, = 2, ρ = 0.8.
(a)
E[y | x = 3]?
(b)
var(y | x)?
(c)
Mahalanobis distance of (3, 1) if ρ were 0?
Check
Ridge on one weight: Σx² = 4, true w = 0.5, noise variance 8, λ = 6.
(a)
Mean squared error of the estimate?
(b)
Error at the best λ?
Check
Bayesian regression of one weight: α = 0.5, β = 2, Σx² = 15, Σxt = 12.
(a)
Posterior mean?
(b)
Predictive standard deviation at x = 1?
(c)
Equivalent ridge λ?
Check
Two classes whose means differ by (1, 1), with diagonal within-class variances 2 and 6.
(a)
Fisher's direction from the first axis?
(b)
Separation J?
Check
A logistic model with = −4, = 0.5, and an example at x = 3 with target 1.
(a)
Predicted probability?
(b)
Gradient with respect to ?
(c)
Decision boundary?
Check
LDA with means 1 and −1 and variance 2²; naive Bayes with prior 0.5 and feature likelihood ratios 4 and 0.25.
(a)
LDA weight?
(b)
Naive Bayes posterior?
Check
TP = 20, FP = 3, FN = 25.
(a)
Precision?
(b)
Recall?
(c)
F1?
Check
A detector with sensitivity 0.8 and specificity 0.92 at prevalence 0.08; scores 2.2 standard deviations apart; a measured accuracy 0.85 on 250 test examples.
(a)
Precision?
(b)
AUC?
(c)
Standard error of the accuracy?
Check
A two-class problem has Bayes error 0.08, and a 1-nearest-neighbor classifier works on 50 features.
(a)
What is the most error 1-NN can have with unlimited data?
(b)
How many test examples does Hoeffding's inequality require to measure its error within ±0.01 at 95% confidence?
(c)
What edge must a neighborhood cube have to hold 1% of uniform data in the unit cube of its features?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
16 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.