applying Python Isomap using sklearn.manifold how to get eigenvalues

195 Views Asked by At

I am trying to use sklearn.manifold Isomap for dimensional reduction.
I have 10 column data and I used number of components = 4.

How can I get the weight of each component?
Is there a method to extract the eigenvalue of each component?

This is the code I used

from sklearn.manifold import Isomap

embedding = Isomap(n_components=4, n_neighbors=6)
X_transformed = embedding.fit_transform(X[:])
X_transformed.shape  
1

There are 1 best solutions below

0
seralouk On

You need to access the kernel_pca method and then you can find the eigenvalues:

embedding.kernel_pca_.eigenvalues_

Here is an example:

from sklearn.datasets import load_digits
from sklearn.manifold import Isomap
X, _ = load_digits(return_X_y=True)
X.shape
embedding = Isomap(n_components=2)
X_transformed = embedding.fit(X[:100])

print(embedding.kernel_pca_.eigenvalues_)
# [891862.11494232 201321.18711327]