

.. _sphx_glr_auto_examples_mixture:

.. _mixture_examples:

Gaussian Mixture Models
-----------------------

Examples concerning the :mod:`sklearn.mixture` module.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example plots the ellipsoids obtained from a toy dataset (mixture of three Gaussians) fitted by the BayesianGaussianMixture class models with a Dirichlet distribution prior (``weight_concentration_prior_type=&#x27;dirichlet_distribution&#x27;``) and a Dirichlet process prior (``weight_concentration_prior_type=&#x27;dirichlet_process&#x27;``). On each figure, we plot the results for three different values of the weight concentration prior.">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_concentration_prior_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_concentration_prior`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Concentration Prior Type Analysis of Variation Bayesian Gaussian Mixture</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices.">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_pdf_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm_pdf`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Density Estimation for a Gaussian mixture</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Examples of the different methods of initialization in Gaussian Mixture Models">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_init_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm_init`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">GMM Initialization Methods</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of several covariances types for Gaussian mixture models.">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_covariances_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm_covariances`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">GMM covariances</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the confidence ellipsoids of a mixture of two Gaussians obtained with Expectation Maximisation (``GaussianMixture`` class) and Variational Inference (``BayesianGaussianMixture`` class models with a Dirichlet process prior).">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Gaussian Mixture Model Ellipsoids</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows that model selection can be performed with Gaussian Mixture Models (GMM) using information-theory criteria &lt;aic_bic&gt;. Model selection concerns both the covariance type and the number of components in the model.">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_selection_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm_selection`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Gaussian Mixture Model Selection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the behavior of Gaussian mixture models fit on data that was not sampled from a mixture of Gaussian random variables. The dataset is formed by 100 points loosely spaced following a noisy sine curve. There is therefore no ground truth value for the number of Gaussian components.">

.. only:: html

  .. image:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_sin_thumb.png
    :alt:

  :doc:`/auto_examples/mixture/plot_gmm_sin`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Gaussian Mixture Model Sine Curve</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_concentration_prior
   /auto_examples/mixture/plot_gmm_pdf
   /auto_examples/mixture/plot_gmm_init
   /auto_examples/mixture/plot_gmm_covariances
   /auto_examples/mixture/plot_gmm
   /auto_examples/mixture/plot_gmm_selection
   /auto_examples/mixture/plot_gmm_sin

