sardine
sardine

Reputation: 23

How to compute a 2-D embedding from a distance matrix?

I would like to draw a map of NYC where the distances between neighborhoods are scaled by transit time. I computed a distance matrix using the Google Maps Distance Matrix API for public transit.

To visualize it, I tried embedding using sklearn.manifold.MDS (metric MDS) and then making a scatter plot. This works kind of ok. Unfortunately, the axes are rescaled as part of this process, and I would like to provide a scale that reflects the raw transit time. In addition, the orientation of the points does not influence the fit, but for drawing a map, it would be nice if I could specify the orientation.

Does anyone have other methods that would be a better fit for my problem? I thought about fixing some reference points and using them to triangulate the remaining points on a map, but I don't know of an off-the-shelf way to do this. enter image description here

Upvotes: 1

Views: 271

Answers (0)

Related Questions