error in Isomap function

조회 수: 1 (최근 30일)
Pritom Kumar Saha
Pritom Kumar Saha 2022년 2월 20일
답변: Pratyush Swain 2025년 3월 20일
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?

답변 (1개)

Pratyush Swain
Pratyush Swain 2025년 3월 20일
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.

카테고리

Help CenterFile Exchange에서 Acoustics, Noise and Vibration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by