<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi David,<div><br></div><div>Thanks for your reply. Right now I'm using vtkKmeansStatistics without learning and am following the example here:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/InfoVis/KMeansClustering">http://www.vtk.org/Wiki/VTK/Examples/InfoVis/KMeansClustering</a></div><div><br></div><div>The output that I get using<span class="Apple-style-span" style="font-family: monospace; white-space: pre; "> kMeansStatistics</span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="sy2">-</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="sy1">></span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">GetOutput</span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="br0">(</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="br0">)</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="sy2">-</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="sy1">></span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">Dump</span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="br0">(</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="br0">)</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span class="sy4"> </span></span>shows the original value, the distance to the nearest cluster, and cluster id it is assigned to, instead of the cluster mean.</div><div><br></div><div><div>+-----------------+-----------------+------------------+</div><div>| Magnitude | distance (0) | closest id (0) |</div><div>+-----------------+-----------------+------------------+</div><div>| 0.0657005 | 6.44972e-06 | 4 |</div><div>| 0.0652216 | 4.24651e-06 | 4 |</div><div>| 0.0646891 | 2.33557e-06 | 4 |</div><div>| 0.0641142 | 9.08931e-07 | 4 |</div><div>| 0.0635069 | 1.19747e-07 | 4 |</div><div>| 0.0666587 | 1.2235e-05 | 4 |</div><div><br></div><div>I think I will probably use learning, but I'd like to get it working without first.</div><div><br></div><div>Thanks,</div><div>Sara </div></div><div><br></div><div><div>On Mar 15, 2011, at 3:27 PM, Thompson, David C wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Sara,<br><br><blockquote type="cite">I'm using vtkKmeansStatistics to successfully cluster data points.<br></blockquote><blockquote type="cite">However, I'm missing how you access the actual cluster mean values,<br></blockquote><blockquote type="cite">instead of just their labels. It looks like the order of the labels<br></blockquote><blockquote type="cite">may not correspond to the values of the means, is this true?<br></blockquote><br>I'm not clear on what you mean by "label". I've run the filter on data with 2 columns (named x & y) and with 2 sets of initial cluster center coordinates specified on the LEARN_PARAMETERS input: one for k=2 and one for k=3. I get this table:<br><br>+----------------+----------------+----------------+----------------+----------------+----------------+-----------------+<br>| Run ID | k | Iterations | Error | Cardinality | x | y |<br>+----------------+----------------+----------------+----------------+----------------+----------------+-----------------+<br>| 0 | 2 | 3 | 1528.94 | 772 | 0.166201 | 0.12059 |<br>| 0 | 2 | 3 | 498.266 | 228 | 2.79467 | 2.99856 |<br>| 1 | 3 | 15 | 546.596 | 397 | -0.341883 | -0.486857 |<br>| 1 | 3 | 15 | 546.946 | 405 | 0.758854 | 0.855424 |<br>| 1 | 3 | 15 | 381.077 | 198 | 2.99941 | 3.14951 |<br>+----------------+----------------+----------------+----------------+----------------+----------------+-----------------+<br><br>as the first block of output 1 (i.e., GetOutputDataObject( 1 ).GetBlock( 0 ).Dump() will produce the above). The first 2 rows contain the cluster mean values corresponding to the run with k=2 and the final 3 rows have the same for the run with k=3. Because there are 2 coordinates (x & y) for each cluster center, there is no good way to order cluster centers by their means. Instead, their order matches the initial guesses at cluster centers specified on the LEARN_PARAMETERS input if it exists. Otherwise, the order is random because the initial guesses are produced randomly. Is this what you wanted to know?<br><br> David<br></div></blockquote></div><br></body></html>