Gensim模型的绘制3D图

问题描述 投票:1回答:1

我已经使用Gensim训练了模型。我使用PCA绘制了一个2D图,但是它并不太清楚。我想将其更改为具有缩放功能的3D。我的结果是如此密集。

from sklearn.decomposition import PCA
from matplotlib import pyplot
X=model[model.wv.vocab]
pca=PCA(n_components=2)
result=pca.fit_transform(X)
pyplot.scatter(result[:,0],result[:,1])
word=list(model.wv.most_similar('eden_lake'))
for i, word in enumerate(words):
  pyplot.annotate(word, xy=(result[i, 0], result[i, 1]))
pyplot.show()

结果:enter image description here

可以这样做吗?

python-3.x pca gensim
1个回答
0
投票

是的,原则上可以对LDA模型结果进行3D可视化。 Here是有关为此使用T-SNE的更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.