I have class labels. Can UMAP use them to separate the classes better?
Answer 1: Pass y to fit for supervised UMAP
UMAP accepts a target, just like a scikit-learn model. It then arranges the embedding so points with the same label stay together:
reducer = umap.UMAP(random_state=42)
emb = reducer.fit_transform(X_train_scaled, y=y_train)
emb_test = reducer.transform(X_test_scaled)
New data is transformed without labels, so you can use this to project test data, then train a classifier on the embedding.
