Ex: Matlab's t-sne tutorials frequently use PCA


" Process Data Using t-SNE

Obtain two-dimensional analogs of the data clusters using t-SNE. Use the Barnes-Hut algorithm for better performance on this large data set. Use PCA to reduce the initial dimensions from 784 to 50. <- (1) Why are we using PCA here to reduce dimensions to 50 first at all if we are going to use t-sne after PCA to reduce to 2 dimensions anyway?

Matlab Tutorial Code: https://www.mathworks.com/help/stats/tsne-settings.html

rng default % for reproducibility 

Y = tsne(X,'Algorithm','barneshut','NumPCAComponents',50); 

figure gscatter(Y(:,1),Y(:,2),L) 

1) See question bolded above

2) What would you have googled to find this out?

I had googled "Why is PCA often used before t-sne for problems when the goal is only to reduce dimensionality? "


t-SNE is computationally expensive, more than PCA. Many examples might use PCA just to simplify the problem.

Moreover, it is explained here:

If the data set is high dimensional, doing principal component analysis is recommended because otherwise the curse of dimensionality can be an issue. TSNE makes the assumption of local linearity which might not hold in high dimensions where the manifold may be varying and PCA can help alleviate this issue by reducing the dimensionality of the data.

In other words, it seems that t-SNE suffers from high dimensionality of your data. It is typically used to represent a manifold in 2-3 dimensions, not tens or hundreds like, for example, PCA. It's mostly a visualization tool IMHO.

On the googling part, I suggest you to search only for the most relevant elements of your search, not for articulated sentences. I googled something like: "why pca before tsne" and it was enought to find useful stuff. Browsers don't need syntactic coherence, just the right keywords.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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