.. _example_mixture_plot_gmm_classifier.py: ================== GMM classification ================== Demonstration of Gaussian mixture models for classification. See :ref:`gmm` for more information on the estimator. 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_001.png :align: center **Python source code:** :download:`plot_gmm_classifier.py ` .. literalinclude:: plot_gmm_classifier.py :lines: 24- **Total running time of the example:** 1.17 seconds ( 0 minutes 1.17 seconds)