Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > e578866d55cd81fdb23827cdf3cec911 > files > 538

python-scikits-learn-0.6-1mdv2010.2.i586.rpm



.. _example_mixture_plot_gmm_classifier.py:


==================
GMM classification
==================

Demonstration of :ref:`gmm` for classification.

Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.

Compares GMMs with spherical, diagonal, full, and tied covariance
matrices in increasing order of performance.  Although one would
expect full covariance to perform best in general, it is prone to
overfitting on small datasets and does not generalize well to held out
test data.

On the plots, train data is shown as dots, while test data is shown as
crosses. The iris dataset is four-dimensional. Only the first two
dimensions are shown here, and thus some points are separated in other
dimensions.


.. image:: images/plot_gmm_classifier.png
    :align: center

**Python source code:** :download:`plot_gmm_classifier.py <plot_gmm_classifier.py>`

.. literalinclude:: plot_gmm_classifier.py
    :lines: 22-