class sklearn.manifold.Isomap(n_neighbors=5, n_components=2, eigen_solver=’auto’, tol=0, max_iter=None, path_method=’auto’, neighbors_algorithm=’auto’, n_jobs=None)
[source]
Isomap Embedding
Non-linear dimensionality reduction through Isometric Mapping
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
[1] | Tenenbaum, J.B.; De Silva, V.; & Langford, J.C. A global geometric framework for nonlinear dimensionality reduction. Science 290 (5500) |
>>> from sklearn.datasets import load_digits >>> from sklearn.manifold import Isomap >>> X, _ = load_digits(return_X_y=True) >>> X.shape (1797, 64) >>> embedding = Isomap(n_components=2) >>> X_transformed = embedding.fit_transform(X[:100]) >>> X_transformed.shape (100, 2)
fit (X[, y]) | Compute the embedding vectors for data X |
fit_transform (X[, y]) | Fit the model from data in X and transform X. |
get_params ([deep]) | Get parameters for this estimator. |
reconstruction_error () | Compute the reconstruction error for the embedding. |
set_params (**params) | Set the parameters of this estimator. |
transform (X) | Transform X. |
__init__(n_neighbors=5, n_components=2, eigen_solver=’auto’, tol=0, max_iter=None, path_method=’auto’, neighbors_algorithm=’auto’, n_jobs=None)
[source]
fit(X, y=None)
[source]
Compute the embedding vectors for data X
Parameters: |
|
---|---|
Returns: |
|
fit_transform(X, y=None)
[source]
Fit the model from data in X and transform X.
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
reconstruction_error()
[source]
Compute the reconstruction error for the embedding.
Returns: |
|
---|
The cost function of an isomap embedding is
E = frobenius_norm[K(D) - K(D_fit)] / n_samples
Where D is the matrix of distances for the input data X, D_fit is the matrix of distances for the output embedding X_fit, and K is the isomap kernel:
K(D) = -0.5 * (I - 1/n_samples) * D^2 * (I - 1/n_samples)
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
transform(X)
[source]
Transform X.
This is implemented by linking the points X into the graph of geodesic distances of the training data. First the n_neighbors
nearest neighbors of X are found in the training data, and from these the shortest geodesic distances from each point in X to each point in the training data are computed in order to construct the kernel. The embedding of X is the projection of this kernel onto the embedding vectors of the training set.
Parameters: |
|
---|---|
Returns: |
|
sklearn.manifold.Isomap
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.manifold.Isomap.html