0
$\begingroup$

Suppose I have high dimensional data (say 32 dimension) and I projected the data onto 2D space. How can I project (or approximate) these 2 dimensional point back onto the original 32 dimensions. \
In particular, I wish to approximate any random point in 2D to the original space. Explanation through python code is much appreciated.

$\endgroup$

1 Answer 1

1
$\begingroup$

You can direct do that in sklearn with inverse_transform().

from sklearn.decomposition import PCA
import numpy as np
X=np.random.rand(100,32)

pca = PCA(n_components=2)
pca.fit(X)
X_reduced=pca.transform(X)


X_inverse=pca.inverse_transform(X_reduced)

Trying with random arrays you see that the operation is not biunivocal because it not necessary produce the original X input.

But if you try to reduce the "inverse" X:

X_inv_red=pca.transform(X_inverse)

You get the same PCA reduction as the original X input.

You can use it in whatever 2D point.

inverse_transform()

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.