Machine Learning, Technology, Data Analysis, Python, Data Science.
PCA pca = PCA(n_components=2) X_pca = pca.fit_transform(X_scaled) # t-SNE tsne = TSNE(n_components=2, perplexity=30) X_tsne = tsne.fit_transform(X_scaled) # Visualize PCA and t-SNE results plt.figure(figsize=(10, 5)) plt.subplot(1, 2, 1) plt.scatter(X_pca[:, 0], X_pca[:, 1], c=y, cmap='viridis')