S1422 of 55
0 XP
  1. Hook
  2. Problems

S14 · Problem set 4

Problem set 4: linear discriminants and Fisher's criterion, the perceptron, logistic regression, Gaussian and naive Bayes classifiers, and evaluating models

These problems cover lessons 15 to 17, 20 and 21: anomaly detection and base rates, distances to decision boundaries, Fisher's direction and separation with correlated features, perceptron updates and mistake bounds, sigmoids, log-odds, softmax losses and cross-entropy gradients, the logistic posterior of Gaussian classes, naive Bayes evidence, and precision, recall, AUC, the error bars on a test score and McNemar's test for comparing two classifiers.

Check

A linear discriminant with w = (2, 1) and w0 = −3.

(a)

Signed distance of (4, 2)?

(b)

Distance of the boundary from the origin?

Check

Classes whose means differ by (1, 2), with a diagonal within-class scatter of variances 2 and 8.

(a)

Fisher's direction, from the first axis?

(b)

Its separation J?

(c)

J along the line joining the means?

Check

A perceptron with w = (1, 2), rate 0.25, updating on a misclassified (3, 2) with target 1; separately, data of radius 3 and margin 0.2.

(a)

New first component?

(b)

Mistake bound?

Check

A logistic model with w0 = −5 and w1 = 0.5.

(a)

Probability at x = 4?

(b)

Decision boundary?

(c)

Odds ratio per unit of x?

Check

The same kind of model (w0 = −3, w1 = 0.5) trains on an example at x = 3 with target 1.

(a)

Gradient with respect to w1?

(b)

Cross-entropy loss for this example?

Check

Log-odds and probabilities.

(a)

Log-odds of 0.6?

(b)

Change in activation to move a prediction from 0.05 to 0.6?

Check

Gaussian classes with means 1 and −1, shared variance 1.5², class 1's prior 0.8.

(a)

Weight on x?

(b)

Offset w0?

(c)

Posterior of class 1 at x = 0.5?

Check

Naive Bayes with prior 0.05 and three features whose likelihood ratios are 3, 0.6 and 4.

(a)

Posterior log-odds?

(b)

Posterior probability?

Check

Two-class classifiers in 8 dimensions.

(a)

Shared-covariance Gaussian parameters?

(b)

Separate covariances?

(c)

Logistic regression?

Check

A confusion matrix: TP = 25, FP = 4, FN = 30, TN = 900.

(a)

Precision?

(b)

Recall?

(c)

F1?

(d)

Accuracy?

Check

A test with sensitivity 0.85 and specificity 0.9 at prevalence 0.05; separately, Gaussian scores 2.5 standard deviations apart.

(a)

Precision?

(b)

AUC?

Check

A test accuracy of 0.75 on 200 examples; separately, 10-fold cross-validation on 2000 examples.

(a)

Standard error?

(b)

Training examples per fit?

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.