PCA 可视化似乎过于密集

问题描述

谁能帮我解决这个问题?我不知道为什么我绘制它时数据会显示为这样。颜色要均匀分布。

enter image description here

这是我的代码

pca = myPCA(n_components = 5) # Conduct myPCA with 5 principal components.
pca.fit(X_train) # Calculate 5 principal components on the training dataset
X_train_pca = pca.transform(X_train)

X_train_pca.shape

import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
figure = plt.figure(dpi=100)
plt.scatter(X_train_pca[:,0],X_train_pca[:,1],c=y_train,s=15,edgecolor='none',alpha=0.5,cmap=plt.cm.get_cmap('tab10',10))
plt.xlabel('component 1')
plt.ylabel('component 2')
plt.colorbar();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)