% % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- addpath( '../../Code/eda_data' ); addpath( '../../Code/eda_toolbox' ); close all; drawnow; clc; clear; randn('seed',0); rand('seed',0); % Modifications on Example 3.5 % This shows how to use the LLE and ISOMAP routines on the scurve dataset % load scurve; % these are loaded in from the "scurve" file, but I want to remember what they are ... N=2000; d = 2; K = 12; % Now run the ISOMAP - we need the distances for input. dists = squareform(pdist(X')); options.dims = 1:10; % These are for ISOMAP. options.display = 0; [Yiso, Riso, Eiso] = isomap(dists, 'k', 7, options); % To get the coordinates, look in the structure Yiso. Note that the % coordinates are also in the form dim x observ. If we want a 2-D % scatter plot, then we use the 2nd record. Typing in Yiso at the % command line shows what is in the structure. tt = linspace( -pi, +pi, N ); scatter(Yiso.coords{2}(1,:), Yiso.coords{2}(2,:), 12, tt, '+'); axis tight; title( 'isomap projection of the scurve data' ); saveas( gcf, '../../WriteUp/Graphics/Chapter3/prob_3_11_isomap', 'epsc' );