title: MATLAB: Self-Organizing Map (SOM) clustering
body: <p>I'm trying to cluster some images depending on the angles between body parts.</p>
  
  <p>The features extracted from each image are:</p>
  
  <pre><code>angle1 : torso - torso
  angle2 : torso - upper left arm
  ..
  angle10: torso - lower right foot
  </code></pre>
  
  <p>Therefore the input data is a matrix of size 1057x10, where 1057 stands for the number of images, and 10 stands for angles of body parts with torso.
  Similarly a testSet is 821x10 matrix.</p>
  
  <p>I want all the rows in input data to be clustered with 88 clusters.
  Then I will use these clusters to find which clusters does TestData fall into?</p>
  
  <p>In a previous work, I used <a href="https://en.wikipedia.org/wiki/K-means_clustering" rel="nofollow noreferrer">K-Means clustering</a> which is very straightforward. We just ask K-Means to cluster the data into 88 clusters. And implement another method that calculates the distance between each row in test data and the centers of each cluster, then pick the smallest values. This is the cluster of the corresponding input data row.</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li><p>Is it possible to do this using <a href="https://en.wikipedia.org/wiki/Self-organizing_map" rel="nofollow noreferrer">SOM</a> in MATLAB? 
  AFAIK SOM's are for visual clustering. But I need to know the actual class of each cluster so that I can later label my test data by calculating which cluster it belongs to.</p></li>
  <li><p>Do you have a better solution?</p></li>
  </ol>