Example: Swiss Roll reduction with LLE

Swiss Roll reduction with LLE

An illustration of Swiss Roll reduction with locally linear embedding

../../_images/sphx_glr_plot_swissroll_001.png

Out:

  Computing LLE embedding
Done. Reconstruction error: 9.45487e-08
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011

print(__doc__)

import matplotlib.pyplot as plt

# This import is needed to modify the way figure behaves
from mpl_toolkits.mplot3d import Axes3D
Axes3D

#----------------------------------------------------------------------
# Locally linear embedding of the swiss roll

from sklearn import manifold, datasets
X, color = datasets.samples_