error in Isomap function

1 view (last 30 days)
Pritom Kumar Saha
Pritom Kumar Saha on 20 Feb 2022
Answered: Pratyush Swain on 20 Mar 2025
I was trying to run the Isomap function on my dataset (32 rows and 1632 columns).
function [Y, R, E] = Isomap(D, n_fcn, n_size, options);
what should be the n_fcn and n_size?
Do I need to do any preprocessing?

Answers (1)

Pratyush Swain
Pratyush Swain on 20 Mar 2025
Hi Pritom,
I guess you are referring to this file exchange function: https://www.mathworks.com/matlabcentral/fileexchange/62449-isomap-d-n_fcn-n_size-options
The Isomap algorithm builds a neighborhood to understand which points are "close" to each other in your high-dimensional data.
  1. 'n_fcn' is the neighborhood selection method. It can be 'k' (for k nearest neighbor) or 'epsilon' (connects to all points within distance epsilon)
  2. 'n_size' is the the value chosen for your neighborhood method 'n_fcn'. If n_fcn = 'k', then n_size should be integer (like 2,5,etc.) or if n_fcn = 'epsilon', then n_size should be distance threshold (0.5,1,etc.)
Isomap works on D(Distance Matrix), a NxN matrix which contains pairwise distance between data points and hence cannot directly work on your raw data. You can perform a preprocessing similar to as follows:
% Data Size: 32 data points with each 1632 features %
% Compute a 32x32 distance matrix %
% Calculates euclidean distance by default, but other distance metrics can be specified %
D = pdist2(data, data);
% Can also conider normalizing the data %
D = normalize(D,2) % Nomalizes each row
% Now you can pass D to Isomap: example usage with k=5 neighbors %
[Y, R, E] = Isomap(D, 'k', 5);
For more information on the functions used above, please refer to
  1. https://www.mathworks.com/help/stats/pdist2.html
  2. https://www.mathworks.com/help/matlab/ref/double.normalize.html
Hope this helps.

Categories

Find more on Acoustics, Noise and Vibration in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!