Is it a valid procedure to apply PCA to your dataset and then apply UMAP clustering on the PCA data, before sending the embedded cluster data to a Random Forest classifier?

Summary of process:

X_train --> x_PCA --> UMAP -->Random Forest

Is this a valid procedure to generate a predictive model??


1 Answer 1


They are 3 different algorithms: they work better in parallel, rather than in series because they have different purposes.

In addition to that, their output always brings some uncertainty (overall PCA), which will increase if reused in other algorithms.

PCA is mainly used to understand better the features: their variance and their linear correlations.

UMAP is non-linear and makes rational clusters for data exploration. You have a navigator here to see the difference between PCA and UMAP.

Random Forest is an actual prediction or classification algorithm, but it depends on your data. In the case of time series, LSTMs or XGBoost could be better.

In conclusion, PCA and UMAP will grant you a better comprehension of your data that would allow you to make a good data preprocessing for your prediction algorithm.

  • $\begingroup$ thanks for your response. As you concluded your dialogue, PCA in series with UMAP is a good preprocessing strategy? You first paragraph says the opposite, right? Please forgive my ignorance in this strategy. Thank you! $\endgroup$
    – Joe
    Jul 2 at 14:19
  • 2
    $\begingroup$ You're welcome Joe. I was not very clear indeed: PCA and UMAP are only useful to understand your data and take better decisions to preprocess it for the predictive algorithm. Their output shall not be used as input for your prediction algorithm. In many data science projects, data comprehension is key in order to have a good predictive model. That's why most notebooks start with data analysis. hands-on.cloud/… $\endgroup$ Jul 2 at 14:29
  • $\begingroup$ Thanks for the reference. Very informative. I sincerely appreciate your time and explanation! $\endgroup$
    – Joe
    Jul 3 at 15:09

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.