python-3.x - 为 Gensim 模型绘制 3D 图
问题描述
我已经使用 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()
有可能这样做吗?
解决方案
是的,原则上可以对 LDA 模型结果进行 3D 可视化。这是有关为此使用 T-SNE 的更多信息。
推荐阅读
- html - 带引导程序的初学者网格 - 行
- pandas - 如何获取结果字典的值。使用 pandas to_dict() 方法时
- acumatica - Acumatica 和 Authorize.net 以及 EMV 阅读器
- excel - 谷歌表格或 Excel 函数根据值返回日期
- forms - 无法更新 Access 表单上的文本框
- android - java.lang.InstantiationException: java.lang.Class
无法实例化 - angular - 将 AWS Cognito 添加到 Angular 应用程序
- linux - 如何将共享文件(标题/源)从 Git 存储库外部推送到它?
- go - 如何分析哪个对象拥有最大内存
- django - 如果由管理员更改,如何更新模板中的订单状态