# Why is PCA often used before t-sne for problems when the goal is only to reduce dimensionality?

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

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

" 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? "

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.