Clear Filters
Clear Filters

MATLAB: How to get the index for each data point in SOM or how do I compute the class vectors of each of the training inputs ??

3 views (last 30 days)
In MATLAB, clustering data using kmeans can be achieved as shown below:
L = kmeans(X,k,Name,Value) where L is cluster indices which is for each data point.
It implies that is if I have 307 data points I'm to have a 307 x 1 array(L) which is the index for each data point.
However, while using SOM for clustering I discovered to get the index you use the code snippet below:
net = selforgmap([dimension1 dimension2]);
% Train the Network
[net,tr] = train(net,X);
%get indices
L = vec2ind(net(X));
for a Network with 5 x 5 dimension:
it returns L which is an array with the dimesion 25 x 1 instead of 307 x 1 for a Network with 10 x 10 dimension:
it returns L which is an array with the dimesion 100 x 1 instead of 307 x 1
What am I doing wrong???
or to simply put, how do I compute the class vectors of each of the training inputs ?

Answers (0)

Categories

Find more on Function Approximation, Clustering, and Control in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!