

.. _example_emregularized_example.py:



Regularized Gaussian mixture on hand-written digits
====================================================

Example of using RegularizedEM with pendigits data.

If you want to do discriminant analysis with pendigits, you quickly have
problems with EM if you use directly the coordinates, because some points are
likely to be on the border, hence the corresponding component can have a
covariance matrix which easily becomes singular. Regularized EM avoids this
problem by using simple regularization on the mixture. You can play with pcount
and pval to see the effect on pdf estimation.

For now, regularized EM is pretty crude, but is enough for simple cases where
you need to avoid singular covariance matrices.

**Source code:** :download:`regularized_example.py <regularized_example.py>`

.. literalinclude:: regularized_example.py
    :lines: 17-
    