Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slisomap
Home > sltoolbox > manifold > slisomap.m

slisomap

PURPOSE ^

SLISOMAP Performs ISOMAP manifold embedding

SYNOPSIS ^

function [X, spectrum] = slisomap(G, d)

DESCRIPTION ^

SLISOMAP Performs ISOMAP manifold embedding

 $ Syntax $
   - X = slisomap(G, d)
   - [X, spectrum] = slisomap(G, d)

 $ Arguments $
   - G:            The distance graph for neighbors
   - d:            The dimension of embedded space
   - X:            The embedded coordinates of the samples
   - spectrum:     The eigenvalues of the embedded dimensions

 $ Description $
   - X = slisomap(G, d) performs ISOMAP manifold embedding to pursue 
     an embedding which best preserves the geodesic distances between
     samples.

   - [X, spectrum] = slisomap(G, d) additionally outputs the
     eigen-spectrum of the embedded space.

 $ Remarks $
   - In current implementation, the third-party toolbox: Matlab BGL is
     required for computing the geodesics.

 $ History $
   - Created by Dahua Lin, on Sep 8, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • slsymgraph SLSYMGRAPH Forces symmetry of the adjacency matrix of a graph
  • slcmds SLMDS Performs Classical Multidimensional scaling
  • raise_lackinput RAISE_LACKINPUT Raises an error indicating lack of input argument
This function is called by:

SOURCE CODE ^

0001 function [X, spectrum] = slisomap(G, d)
0002 %SLISOMAP Performs ISOMAP manifold embedding
0003 %
0004 % $ Syntax $
0005 %   - X = slisomap(G, d)
0006 %   - [X, spectrum] = slisomap(G, d)
0007 %
0008 % $ Arguments $
0009 %   - G:            The distance graph for neighbors
0010 %   - d:            The dimension of embedded space
0011 %   - X:            The embedded coordinates of the samples
0012 %   - spectrum:     The eigenvalues of the embedded dimensions
0013 %
0014 % $ Description $
0015 %   - X = slisomap(G, d) performs ISOMAP manifold embedding to pursue
0016 %     an embedding which best preserves the geodesic distances between
0017 %     samples.
0018 %
0019 %   - [X, spectrum] = slisomap(G, d) additionally outputs the
0020 %     eigen-spectrum of the embedded space.
0021 %
0022 % $ Remarks $
0023 %   - In current implementation, the third-party toolbox: Matlab BGL is
0024 %     required for computing the geodesics.
0025 %
0026 % $ History $
0027 %   - Created by Dahua Lin, on Sep 8, 2006
0028 %
0029 
0030 %% parse and verify input
0031 
0032 if nargin < 2
0033     raise_lackinput('slisomap', 2);
0034 end
0035 
0036 G = slgraphmat(G, 'sparse', true);
0037 n = size(G, 1);
0038 if d >= n
0039     error('sltoolbox:exceedbound', ...
0040         'The embedded dimension d should be less than the number of samples');
0041 end
0042 
0043 
0044 %% compute
0045 
0046 % compute geodesics
0047 G = slsymgraph(G);
0048 D = all_shortest_paths(G);
0049 
0050 is_inf_dists = isinf(D);
0051 is_inf_dists = is_inf_dists(:);
0052 if any(is_inf_dists)
0053     error('sltoolbox:rterror', ...
0054         'The graph has multiple disconnected components');
0055 end
0056 clear is_inf_dists;
0057 
0058 % perform MDS on D
0059 [X, spectrum] = slcmds(D, d);
0060

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com