All questions
Work closed-book. Answers live in the collapsed callouts of each include (same files as the chapter Recall sections). Official PDFs remain the mock of record for full banks.
Labels in the includes: Official / Official-style = course bank or exercise wording; Original = written for this book.
Clustering
K-means
Six points A–F as in the exercise set. Start at \boldsymbol{\mu}_1=A=(1,1), \boldsymbol{\mu}_2=D=(7,7). Assign, then update.
Answer
Assign: \{A,B,C\} to 1, \{D,E,F\} to 2. Updated centroids: (4/3,4/3) and (22/3,22/3). Reason: nearest-centroid assignment, then cluster means.a(i)=1.20, b(i)=1.50. Compute s(i) and interpret.
Answer
s(i)=0.20. Mildly positive: own cluster is closer, but not by much. Follow up: inspect the observation on a silhouette plot or compare distances to the competing cluster.What does kmeans(x, centers = 4, nstart = 25) do with set.seed set?
Answer
Seed makes the random process repeatable;nstart = 25 tries several initialisations and retains a lowest-WCSS solution among them. It does not guarantee the global optimum.
What does a negative silhouette say most directly?
Answer
The nearest alternative cluster is closer on average than the assigned cluster.A partition is identical across 100 seeds with nstart = 25, but changes across 90% subsamples. What does that say?
Answer
Initialisation is not the main weak point; the clustering is sensitive to which observations are present. Seed reproducibility alone is not enough.Also sit Question banks/kmeans-exercise-set.pdf Sections A–C without scaffolding.
Hierarchical
For clusters G and H, single-linkage dissimilarity is…
Answer
The minimum pairwise dissimilarity between a point in G and a point in H. Reason: “closest members” rule.Using the four-point complete-linkage matrix above, state the first merge height and the K=2 partition.
Answer
First merge \{A,B\} at height 2. At K=2: \{A,B\} and \{C,D\}. Reason: smallest pairwise distance merges first; complete linkage then uses maxima between groups.GPS tracks form elongated routes; a few isolated errors remain. Why is single linkage risky?
Answer
One bridge point (or error) can link distinct routes because only the minimum cross distance matters. Prefer average or complete when compact programme groups are required.Single linkage K=2 has higher average silhouette than average linkage K=3, but K=2 merely separates salinity extremes while the brief asks for multivariate handling profiles. Strongest conclusion?
Answer
Prefer average linkage at K=3 provisionally if it matches the stated purpose; report the weaker silhouette and validate. Largest silhouette is not an automatic override of the decision question.Why does hierarchical clustering need no nstart?
Answer
For fixed dissimilarities and linkage, each merge is determined by the linkage rule. Random initialisation is not part of the algorithm. Sensitivity still appears through the sample and the linkage choice.Also sit Question banks/hierarchical-clustering-exercise-set.pdf Sections A–C without scaffolding.
Dimension reduction
PCA
Why restrict loadings to unit length? Is unit length special?
Answer
Without a fixed length, coefficients can be scaled up to inflate variance without changing direction. Unit length is convenient; it makes \operatorname{Var}(Y_i)=\lambda_i.Problem with simply maximising variance for each component?
Answer
Every component would choose the same direction as the first. Later loadings must be orthogonal to earlier ones (and length-constrained).\mathbf{x}=(2,-1,3)', \mathbf{a}_1=(1/3,2/3,2/3)'. Score?
Answer
y_1=2.Same \mathbf{a} and \boldsymbol{\Sigma} as above. Variance?
Answer
16/9.MDS
How many parameters for a 2-D map? For a k-D map?
Answer
2n and kn: one coordinate per observation per map dimension.Contrast the three.
Answer
\delta_{ij} input dissimilarity; d_{ij} fitted Euclidean map distance; \hat{d}_{ij}=f(\delta_{ij}) disparity in non-metric MDS.Why prefer non-metric over metric MDS?
Answer
When only the ranking of dissimilarities is meaningful, not their numerical magnitudes.Does downweighting large \delta_{ij} change how we interpret metric MDS distances? What changes in non-metric MDS?
Answer
Metric: no — distances still target numerical dissimilarities; weights only redirect effort. Non-metric: only order may be interpreted.ISOMAP
Why classical rather than non-metric MDS inside ISOMAP?
Answer
Classical MDS is faster; non-linearity is already in the graph distances.Does ISOMAP use geodesic distances?
Answer
Approximately: shortest paths on a neighbourhood graph, not continuous geodesics on the manifold.Effect of k=1 vs k=n-1?
Answer
k=1: often disconnected. k=n-1: reduces to classical MDS on Euclidean edges.In what sense is the Swiss roll 2-D in 3-D?
Answer
Three observed coordinates, but position on the surface is fixed by two intrinsic coordinates (along the sheet and height).SOM
Does an empty node have a prototype? How?
Answer
Yes. Initialised, then updated when neighbouring nodes are BMUs.What is the best matching unit?
Answer
The node whose prototype is closest to the observation in data space.With the bank’s numbers, \sigma^2?
Answer
\approx 18.03, from h=0.5 and \|\Delta\boldsymbol{\ell}\|^2=25.Define both and how they complement.
Answer
QE: average distance to BMU. TE: how often first and second BMUs are non-adjacent. One scores data-space fit; the other scores grid topology.In what sense is a SOM restricted k-means?
Answer
Prototypes are pulled by neighbours, so they cannot match their own observations as freely as independent centroids.Autoencoders
Roles?
Answer
Encoder → code; bottleneck holds the code; decoder reconstructs toward the input space.When does an autoencoder behave like PCA?
Answer
When activations are linear (squared-error training): same subspace, possible rotation.Input and target? Why?
Answer
Input corrupted; target clean original. Builds robustness and blocks trivial identity maps.Why required?
Answer
Flexible models overfit; need validation/test reconstruction to judge generalisation.Full official DR bank: Question banks/QuestionBankQuestions.pdf with solutions in Question banks/QuestionBankSolutions.pdf.
Last year’s paper (coding shape only)
STA5077Z Exam Pack/ExamQuestions.pdf — skip DBSCAN and market basket. Use PCA / MDS / ISOMAP / AE / k-means / hierarchical items as timing practice.