

.. _example_manifold_plot_lle_digits.py:


=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================

An illustration of various embeddings on the digits dataset.

The RandomTreesEmbedding, from the :mod:`sklearn.ensemble` module, is not
technically a manifold embedding method, as it learn a high-dimensional
representation on wich we apply a dimensionality reduction method.
However, it is often useful to cast a dataset into a representation in
which the classes are linearly-seperable.



.. rst-class:: horizontal


    *

      .. image:: images/plot_lle_digits_1.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_2.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_3.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_4.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_5.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_6.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_7.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_8.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_9.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_10.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_11.png
            :scale: 47

    *

      .. image:: images/plot_lle_digits_12.png
            :scale: 47


**Script output**::

  Computing random projection
  Computing PCA projection
  Computing LDA projection
  Computing Isomap embedding
  Done.
  Computing LLE embedding
  Done. Reconstruction error: 1.28545e-06
  Computing modified LLE embedding
  Done. Reconstruction error: 0.357721
  Computing Hessian LLE embedding
  Done. Reconstruction error: 0.212223
  Computing LTSA embedding
  Done. Reconstruction error: 0.212076
  Computing MDS embedding
  Done. Stress: 147886279.081267
  Computing Totally Random Trees embedding
  Computing Spectral embedding



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

.. literalinclude:: plot_lle_digits.py
    :lines: 14-

**Total running time of the example:**  25.40 seconds
    