Question: Question 5 - Kernel PCA ( Bonus 1 0 points ) PCA is a useful tool to lower the dimensions of the data and get

Question 5- Kernel PCA (Bonus 10 points)
PCA is a useful tool to lower the dimensions of the data and get much less feature that yet represent the data. Even though, sometimes the original data is not good enough, so we want to map the data into higher (or same) dimension!
Recall that in PCA, we require the samples to be mean-centered, 1ni=1nxi=0.
We now want to do the same thing, but after x was mapped into (x). Denote the following, mean-centered version of (x) :
vi=(xi)-1nt=1n(xt)
However, we won't always have access to / costs a lot of computation (and won't be able to compute v1,dots,vn).
Therefore, we will use the kernel trick. Denote K' as the kernel matrix for v1,dots,vn. Show how K' can be calculated using only the original kernel matrix K on x1,dots,xn.
Reminder: Ki,j'=(:vi,vj:)(since the new kernel is linear in terms of (x)).
2. Now, for the rest of the question we assume that 1ni=1n(xi)=0.
We would like to apply PCA to the vectors (xi). Denote by u1,dots,ukinRd' the first k principal components, the eigenvectors of the scatter matrix S .
Show that uj(for j=1,dots,k) is linear combination of (x1),dots,(xn).
Moreover, show who are the j,1,dots,j,k such that uj=i?i(xi).
3. Use the expression for j,1,dots,j,n and find an algorithm to obtain the entire j=[j,1,dotsj,n] using K.
Hint: substitute uj you found in the expression for i,j you found.
4. Since we don't really know , we can't use uj. But we also don't need them!
Their only purpose was to project (x) onto the new dimension, using the dot product, zj=(:uj,(x):)(and (:zi=[z1idotszki]}.
Show how to calculate zj without using .
5. Now, use sklearn and apply Kernel PCA with 'cosine' kernel (doesn't have hyperparameters) and classify with KNN using 125 neighbors, on the same data from question 3.
Did it do better than the regular PCA (on the test set)?
MAKE SURE TO SAVE IT TO COLAB
Question 5 - Kernel PCA ( Bonus 1 0 points ) PCA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!