Interactive demo · Statistical Learning: Theory and Methods · Chapter 18

Nearest shrunken centroids

The SRBCT data have 2308 genes and only 63 training samples in four tumour classes. Diagonal LDA classifies a sample to the nearest class centroid after scaling each gene by its pooled standard deviation. Nearest shrunken centroids first shrinks every standardised centroid contrast dkj towards zero by soft thresholding at Δ; a gene whose contrasts are all shrunk to zero no longer affects the classifier. Move Δ and watch the genes drop out and the errors change.

Threshold Δ

Thresholding

Offset s₀ in the standardisation

Loading the SRBCT data…

Try these

Each gene is standardised by sj + s₀ (pooled within-class standard deviation plus the median of the sj). Priors are the class proportions. Cross-validation uses 10 fixed folds balanced by class, and everything (means, sj, s₀) is recomputed without the held-out fold. The 20 test samples are never used for fitting.

In the lecture notes