error in Isomap function

4 ビュー (過去 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 Center および File ExchangeAcoustics, Noise and Vibration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by