graphclust.vq.BaseTopologyLearner#

class graphclust.vq.BaseTopologyLearner[source]#

Bases: ClusterMixin, TransformerMixin, BaseEstimator

Common interface of the vector quantizers and topology learners.

graph_distances(connect=True)[source]#

Geodesic distances between the nodes along adjacency_ (components joined if connect).

predict(X)[source]#

Index of the nearest node (best matching unit) of every sample.

quantization_error(X)[source]#

Mean squared distance of the samples to their nearest node, \(\frac1N\sum_k\min_i\|\mathbf{x}_k-\mathbf{w}_i\|^2\).

transform(X)[source]#

Euclidean distances of the samples to every node, shape (n_samples, n_nodes).