Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active August 29, 2015 14:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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