Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lettergram/79fc9d39f6de5881b004 to your computer and use it in GitHub Desktop.
Save lettergram/79fc9d39f6de5881b004 to your computer and use it in GitHub Desktop.
Graph seed dataset PCA
% Graphs components %
file = 'seeds_dataset.csv';
x = load(file);
% SVD matrix
[U,S,V] = svd(x * transpose(x));
% An eigenvalue is the diagonal matrix of S off the SVD component
eV = diag(sqrt(S));
% Plot the eigenvalues against eachother
scatter(eV, eV, 'filled');
% Plot only the top 10 sorted eigenvalue
scatter(linspace(1,10,10), eV(1:10), 'filled')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment