Manifold Learning MATLAB 
demo
Manifolds 
 “According to mathematics, manifold is a collection of points 
forming a certain kind of set, such as those of topologically 
closed surface.” 
 Example: Surface, Curve & point.
Terms to be used in code 
 X = data as D x N matrix (D = dimensionality, N = #points) 
 K = number of neighbors 
 dmax = max embedding dimensionality 
 Y = embedding as dmax x N matrix
General Code 
 X=rand(10,50); 
 k=20; 
 dmax=2; 
 [Y] = lle(X,k,dmax);
Functioning of code in MATLAB
Animated Version using MATLAB 
The input data can be read from a 
matrix in the workspace, from a text 
file, or selected from one of 8 built-in 
examples.
Description to every option 
 Load Matrix: Enter the name of a matrix in the MATLAB workspace 
and press this button. 
The matrix should be NxD, where 
N is the number of data items; 
D is the dimension of the manifold. 
 Load File: Enter the name of a text file and press this button. The text 
file should contain numbers separated by spaces with each data 
element as a row.
Parameters used in simulation 
 Target Dimension d: The desired dimension of the embedding. In 
general, the target dimension d should be less than the input 
manifold dimension D. 
 Nearest Neighbors K: Specifies the number of nearest neighbors 
(KNN) used to build the graph for the following methods: ISOMAP, 
LLE, Hessian LLE, Laplacian, and LTSA.
 Sigma: This specifies the width of the Gaussian kernel in the Diffusion Map 
method. 
 Alpha: This parameter controls the normalization used by Diffusion Map. 
Alpha = 0 is the Graph Laplacian 
Alpha = 1/2 is the Fokker-Plank propagator 
Alpha = 1 is the Laplace-Beltrami operator
Output 
The output for: 
d = 2; 
k = 8; 
Sigma = 10.0; 
Alpha = 1.0;

Understand Manifolds using MATLAB

  • 1.
  • 2.
    Manifolds  “Accordingto mathematics, manifold is a collection of points forming a certain kind of set, such as those of topologically closed surface.”  Example: Surface, Curve & point.
  • 3.
    Terms to beused in code  X = data as D x N matrix (D = dimensionality, N = #points)  K = number of neighbors  dmax = max embedding dimensionality  Y = embedding as dmax x N matrix
  • 4.
    General Code X=rand(10,50);  k=20;  dmax=2;  [Y] = lle(X,k,dmax);
  • 5.
  • 6.
    Animated Version usingMATLAB The input data can be read from a matrix in the workspace, from a text file, or selected from one of 8 built-in examples.
  • 7.
    Description to everyoption  Load Matrix: Enter the name of a matrix in the MATLAB workspace and press this button. The matrix should be NxD, where N is the number of data items; D is the dimension of the manifold.  Load File: Enter the name of a text file and press this button. The text file should contain numbers separated by spaces with each data element as a row.
  • 8.
    Parameters used insimulation  Target Dimension d: The desired dimension of the embedding. In general, the target dimension d should be less than the input manifold dimension D.  Nearest Neighbors K: Specifies the number of nearest neighbors (KNN) used to build the graph for the following methods: ISOMAP, LLE, Hessian LLE, Laplacian, and LTSA.
  • 9.
     Sigma: Thisspecifies the width of the Gaussian kernel in the Diffusion Map method.  Alpha: This parameter controls the normalization used by Diffusion Map. Alpha = 0 is the Graph Laplacian Alpha = 1/2 is the Fokker-Plank propagator Alpha = 1 is the Laplace-Beltrami operator
  • 10.
    Output The outputfor: d = 2; k = 8; Sigma = 10.0; Alpha = 1.0;

Editor's Notes

  • #6 File Name: Computer -> Education -> Internship Details -> LLE -> LLE MATLAB Code -> lle.m
  • #7 File Name: Computer -> Education -> Internship Details -> LLE -> LLE MATLAB Code -> mani.m
  • #8 Color Vector: Checking this box indicates that there is a N-dimensional column vector in the workspace that specifies the colors of the NxD input matrix.
  • #9 Nearest Neighbors ‘K’ : If K is too large or too small, the local geometry may not be interpreted correctly. The default is K=8, which seems to work well for the examples