Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active Aug 29, 2015
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