Hello David<br><br>The cluster centers are given through the model output port of the k-means engine.<br><br>Specifically, you can retrieve them as follows:<br><br> vtkMultiBlockDataSet* outputMetaDS <br>  = vtkMultiBlockDataSet::SafeDownCast( kmeans-&gt;GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) );<br>
<br>where kmeans is the vtkKMeansStatistics* previously executed.<br><br>The first block is a vtkTable created by the Learn operation, i.e., the operation that executes as many clustering operations as requested, with those values of k that were requested.<br>
As a result, there is a row per Run ID and per cluster center.<br><br>For example, with a single run and k=3, one obtains the following:<br>+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+------------------+<br>
| Run ID          | K               | Iterations      | Error           | Cardinality     | coord 0         | coord 2          |<br>+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+------------------+<br>
| 0               | 3               | 4               | 1.27871         | 19              | 0.226315        | 0.403089         |<br>| 0               | 3               | 4               | 1.08932         | 18              | 0.618059        | 0.744096         |<br>
| 0               | 3               | 4               | 0.46612         | 13              | 0.73027         | 0.228617         |<br>+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+------------------+<br>
<br>I hope this helps. For more detail, you might want to have a look at the SAND report which we wrote at the time:<br>  <a href="http://www.kitware.com/InfovisWiki/images/1/18/SAND2009-7855.pdf">http://www.kitware.com/InfovisWiki/images/1/18/SAND2009-7855.pdf</a><br>
or more generally <a href="http://www.kitware.com/InfovisWiki/index.php/Statistics_Engines">www.kitware.com/InfovisWiki/index.php/Statistics_Engines</a><br><br>Please let me know should you have any other question. Thank you<br>
Philippe<br><br><br><div class="gmail_quote">On Tue, Nov 22, 2011 at 4:23 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I would like to know the resulting cluster centers after running<br>
vtkKMeansStatistics. I don&#39;t see an interface to do this - am I<br>
missing it? Or would I have to loop over all of the points and average<br>
the coordinates of points with a particular cluster id?<br>
<br>
Thanks,<br>
<br>
David<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Philippe Pébay<br>Directeur de la Visualisation et du Calcul Haute Performance<br>
Kitware SAS<br>
20 rue de la Villette<br>
69328 Lyon cedex 03, France<br>
<a value="+33426685003">+33 (0)4.26.68.50.03</a><br>
<a href="http://www.kitware.fr/" target="_blank">http://www.kitware.fr</a></font><br>