fuzzyclust.graph.minimum_spanning_tree#

fuzzyclust.graph.minimum_spanning_tree(X, backend='scipy')[source]#

Euclidean minimal spanning tree of the samples.

Parameters:
Xarray_like of shape (n_samples, n_features)
backend{“scipy”, “networkx”}, default=”scipy”

"scipy" uses scipy.sparse.csgraph.minimum_spanning_tree() (Kruskal) on the dense distance matrix; "networkx" uses networkx.minimum_spanning_tree() and requires the optional dependency fuzzyclust[graph]. Both return the same tree up to ties.

Returns:
edgesndarray of shape (n_samples - 1, 2)

End points (row indices into X) of the tree edges.

weightsndarray of shape (n_samples - 1,)

Euclidean lengths of the edges.