Isomap backend¶
Use backend="isomap" for a fast deterministic alternative:
model = SpatialDeformer(
backend="isomap",
cost="travel_time_s",
geo_weight=0.1,
)
warped = model.fit_transform(edges)
What “Isomap” means here¶
Ordinary Isomap has three conceptual stages:
- construct a neighborhood graph;
- compute shortest-path geodesic distances;
- apply classical scaling to those distances.
SpatialDeform already receives an explicit edge graph and travel costs, so the first two stages are defined by the user’s network. The backend performs classical scaling directly on the resulting graph shortest-path matrix.
The embedding is then aligned to the original geography with an orthogonal
Procrustes transform. geo_weight blends the aligned embedding toward the
geographic coordinates:
When to use it¶
Isomap is useful when:
- deterministic one-pass fitting is important;
- the network’s geodesic structure embeds cleanly in two dimensions;
- you want a comparison baseline for regularized MDS;
- MDS iteration time is material on a medium network.
Prefer MDS when you need direct control over spatial pair weights or want the geographic preservation term to participate in the optimization itself.
Why PCA is not a backend¶
PCA expects samples described by numeric feature columns. A travel-cost matrix is a dissimilarity matrix: each value says how far two nodes are, not which features describe a node. Applying PCA directly would therefore answer a different question.
Why t-SNE and UMAP are not defaults¶
t-SNE and UMAP are powerful neighborhood visualizers, but they intentionally trade global metric fidelity for local structure. A cartogram requires visual distance and large-scale contraction/expansion to remain interpretable. SpatialDeform’s backend interface can be extended later, but new backends must make that tradeoff explicit.