We can now apply this algorithm to the Olivetti faces dataset, instantiating the Scikit-Learn class LocallyLinearEmbedding with n_components=2 and n_neighbors=15:
from sklearn.manifold import LocallyLinearEmbeddinglle = LocallyLinearEmbedding(n_neighbors=15, n_components=2)X_lle = lle.fit_transform(faces['data'])
The result (limited to the first 100 samples) is shown in the following plot:
Even if the strategy is different from Isomap, we can determine some coherent clusters. In this case, the similarity is obtained through ...