简体   繁体   English

从欧几里得距离矩阵创建 3D 点云

[英]Creating a 3D point cloud from an euclidian Distance Matrix

I have a huge matrix that came out from a text similarity analysis like我有一个巨大的矩阵,它来自文本相似性分析,例如

elem/elem元素/元素 text1文本1 text2文本2 text3文本3 text4文本4
text1文本1 1 1 0.8 0.8 0.6 0.6 0.18 0.18
text2文本2 0.8 0.8 1 1 0.73 0.73 0.29 0.29
text3文本3 0.6 0.6 0.73 0.73 1 1 0.6 0.6
text4文本4 0.18 0.18 0.29 0.29 0.6 0.6 1 1

I want to create a 3D cloud point that represent all my element in a 3D space with the distance between points according to the relative distance to all other elements我想创建一个 3D 云点,它代表 3D 空间中的所有元素,点之间的距离根据与所有其他元素的相对距离

I would like to transform my table into something more like this:我想把我的桌子变成更像这样的东西:

points=[
{'text1':[x,y,z]},
{'text2':[x,y,z]},
{'text3':[x,y,z]},
{'text4':[x,y,z]},
]
edges=[
[[x,y,z],[x,y,z]],
[[x,y,z],[x,y,z]]
[[x,y,z],[x,y,z]]
[[x,y,z],[x,y,z]]
[[x,y,z],[x,y,z]]
]

I will implement the computation in python with numpy and pandas, and the rendering in a vueJS app, with a 3d lib such a D3js.我将使用 numpy 和 pandas 在 python 中实现计算,并在 vueJS 应用程序中使用 3d 库(如 D3js)进行渲染。

I'm for now searching for the right algorithmic approach to convert distance matrix into absolute 3D coordinate.我现在正在寻找将距离矩阵转换为绝对 3D 坐标的正确算法方法。

Thanks a lot for the help.非常感谢您的帮助。

Thanks for the comment.感谢您的评论。 i finally went for a force weigthed graph我终于找到了一个力加权图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM