Skip to article frontmatterSkip to article content

Dimensionality reduction

Fitting an autoencoder by hand

Let’s say you have the following dataset, D={x1,x2}\mathcal{D}=\{x_1,x_2\}, shown below.

   **Sample**   Height   Weight
  ------------ -------- --------
       #1         1        2
       #2         1        4
       #3         1        6
       #4         1        13

Say you use this data and find an optimal linear autoencoder with one latent dimension. You get two functions, fe: R2Rf_e:\ \mathbb{R}^2\rightarrow \mathbb{R}, and fd: RR2f_d:\ \mathbb{R}\rightarrow \mathbb{R}^2.

What will be the value of

i=16fd(fe(xi))xi2?\sum_{i=1}^6\Vert f_d(f_e(x_i))-x_i\Vert^2?

(Hint: it may be helpful to try to explicitly find suitable functions fe,fdf_e,f_d.)

Reconstruction error

You have been given an autoencoder:

fe(x1,x2,x3)=(0.5x1+0.5x2,x3)fd(z1,z2)=(z1,z1,z2) \begin{aligned} f_e(x_1,x_2,x_3) &= (0.5*x_1+0.5*x_2,x_3) \\ f_d(z_1,z_2) &= (z_1,z_1,z_2) \ \end{aligned}

What is the squared reconstruction error for the point x=(2,4,6)x=(2,4,6)?

PCA and scaling

You have a dataset D\mathcal{D} with n=100n=100 samples and p=30p=30 features per sample. You run PCA to get a 2d latent representations (summaries) for each point. You store these summaries in a matrix, UR100×2U \in \mathbb{R}^{100 \times 2}. Then you standardize your dataset with the standard scaler, run PCA on the standardized data, and get a different matrix of summaries U~R100×2\tilde U \in \mathbb{R}^{100 \times 2}. Which is true?

  1. U=U~U=\tilde U.

  2. There exists a 2×22\times 2 matrix AA such that UA=U~UA=\tilde U.

  3. None of the above.

Variance explained

Let XRpX \in \mathbb{R}^p be a random variable. Let μ=E[X]\mu=\mathbb{E}[X] and b=E[Xμ2]b=\mathbb{E}[\Vert X - \mu \Vert^2]. Say you have fit an autoencoder fe,fdf_e,f_d. Say the mean squared reconstruction error is given by ϵ=E[fd(fe(X))X2]\epsilon = \mathbb{E}[\Vert f_d(f_e(X))-X\Vert^2]. What is the formula for the proportion of variance explained by the autoencoder?