Isomap is a nonlinear dimensionality reduction technique that preserves geodesic distances along a data manifold. Unlike linear methods that use straight-line distances, Isomap approximates manifold distances by finding shortest paths through a neighborhood graph.
Write a function isomap(X, n_neighbors, n_components) that returns a low-dimensional embedding.
n_neighbors closest points (excluding itself). Symmetrize the graph (an edge exists if either endpoint lists the other as a neighbor) and use the Euclidean distances as edge weights.n_components eigenvalues/eigenvectors of .X: data matrix of shape (n_samples, n_features) (list of lists or numpy array)n_neighbors: integer, number of neighbors used to build the graphn_components: integer, dimensionality of the output embedding