A data set from model (18.37): 100 samples and 5000 genes. Genes 1–50 shift by one unit between samples 1–50 and 51–100 and drive the outcome y; genes 51–250 carry a much larger shift (four units) between two other groups of samples that has nothing to do with y; the rest is noise. Principal components regression on all genes finds the large irrelevant factor first. Supervised principal components first keeps the k genes most correlated with y, then takes principal components of those.
Genes are ranked by the absolute correlation of each gene with y on the training samples (step 1 of Algorithm 18.1). The test set is a second data set of the same design. Errors are root-mean-square test errors divided by the noise standard deviation 1.5, so the best possible value is about 1. With k = 5000 supervised principal components is ordinary principal components regression, and thresholded PLS is ordinary one-component PLS.
code/ch18_high_dimensional_problems.py (spc_predict, tpls_predict, demo_spc).