简体   繁体   中英

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 text2 text3 text4
text1 1 0.8 0.6 0.18
text2 0.8 1 0.73 0.29
text3 0.6 0.73 1 0.6
text4 0.18 0.29 0.6 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

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.

I'm for now searching for the right algorithmic approach to convert distance matrix into absolute 3D coordinate.

Thanks a lot for the help.

Thanks for the comment. i finally went for a force weigthed graph

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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