TRNMap component planes#

The nodes of a TRNMap carry codebook vectors in the original space. Drawing the map once per variable, with the nodes shaded by that variable, gives component planes: correlated variables produce similar shadings, and cluster borders show up as sharp changes. Here the map of the S curve is shaded by its three coordinates; the vertical coordinate varies along the unrolled sheet, the depth across it.

x, y, z
from graphclust import TRNMap
from graphclust.datasets import make_s_curve
from graphclust.plotting import plot_component_planes

X, t = make_s_curve(2000, random_state=0)

# [snippet:planes]
tm = TRNMap(n_nodes=150, random_state=0).fit(X)
fig = plot_component_planes(tm.embedding_, tm.nodes_, tm.adjacency_, feature_names=["x", "y", "z"], ncols=3)
# [/snippet:planes]

Total running time of the script: (0 minutes 0.786 seconds)

Gallery generated by Sphinx-Gallery