.. _book_fig_chapter6_fig_kmeans_metallicity: EM example: K-means ------------------- Figure 6.13 The K-means analysis of the stellar metallicity data used in figure 6.6. Note how the background distribution "pulls" the cluster centers away from the locus where one would place them by eye. This is why more sophisticated models like GMM are often better in practice. .. image:: ../images/chapter6/fig_kmeans_metallicity_1.png :scale: 100 :align: center .. raw:: html
**Code output:** .. raw:: html
.. literalinclude:: fig_kmeans_metallicity.txt .. raw:: html
**Python source code:** .. raw:: html
.. literalinclude:: fig_kmeans_metallicity.py :lines: 11- .. raw:: html
:download:`[download source: fig_kmeans_metallicity.py] ` .. raw:: html