MCPcopy Index your code
hub / github.com/clips/pattern / cluster

Function cluster

pattern/vector/__init__.py:1448–1454  ·  view source on GitHub ↗

Clusters the given list of vectors using the k-means or hierarchical algorithm.

(method=KMEANS, vectors=[], **kwargs)

Source from the content-addressed store, hash-verified

1446 return d
1447
1448def cluster(method=KMEANS, vectors=[], **kwargs):
1449 """ Clusters the given list of vectors using the k-means or hierarchical algorithm.
1450 """
1451 if method == KMEANS:
1452 return k_means(vectors, **kwargs)
1453 if method == HIERARCHICAL:
1454 return hierarchical(vectors, **kwargs)
1455
1456#--- K-MEANS ---------------------------------------------------------------------------------------
1457# k-means is fast but no optimal solution is guaranteed (random initialization).

Callers

nothing calls this directly

Calls 2

k_meansFunction · 0.85
hierarchicalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…