error in Isomap function

1 visualización (últimos 30 días)
Pritom Kumar Saha
Pritom Kumar Saha el 20 de Feb. de 2022
Respondida: Pratyush Swain el 20 de Mzo. de 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?

Respuestas (1)

Pratyush Swain
Pratyush Swain el 20 de Mzo. de 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.

Categorías

Más información sobre Acoustics, Noise and Vibration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by