cluster_centroids
cluster_centroids_euclidean(positions, masses, cluster_indices)
Computes euclidean centroids for a set of clusters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions |
(n, d) numpy float array
|
d-dimensional positions. |
required |
masses |
(n, ) numpy float array
|
Masses/weights for each of the n-positions. |
required |
cluster_indices |
(n, ) numpy int array
|
Cluster indices. |
required |
Returns:
Name | Type | Description |
---|---|---|
centroids |
(num_clusters, d) numpy float array
|
Centroids in euclidean space. |
Source code in src\fast_cody\cluster_centroids.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
cluster_centroids_spectral(B, cluster_indices)
Computes for clusters in spectral space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
B |
(n, d) numpy float array
|
d-dimensional spectral feature vectors. |
required |
cluster_indices |
(n, ) numpy int array
|
Cluster indices. |
required |
Returns:
Name | Type | Description |
---|---|---|
centroids |
(num_clusters, d) numpy float array
|
Centroids in spectral space. |
Source code in src\fast_cody\cluster_centroids.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|