Hi Desiree,
To embed each column of “X” onto the eigenvectors, the approach is to extract out the desired eigenvectors and perform matrix multiplication with them. To achieve this, follow the following steps:
- Exclude the first eigenvector “V(:,1)” using indexing, and then extract next 3 and 4 eigenvectors.
V_non_trivial = V(:, 2:end);
V_first_3 = V_non_trivial(:, 1:3);
V_first_4 = V_non_trivial(:, 1:4);
- Now, project the data by multiplying “X” with the transpose of selected eigenvectors to obtain the embedding.
embedding_3 = V_first_3' * X;
embedding_4 = V_first_4' * X;
This is how we can embed the data points (columns of X) into a lower-dimensional space using the first 3 or 4 non-trivial eigenvectors.
To know more about indexing in MATLAB, refer to the following documentation link: