new KMedoids(matrix, K, max_iteropt, metricopt, seedopt) → {KMedoids}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
matrix | Matrix | data matrix | ||
K | Numbers | number of clusters | ||
max_iter | number | <optional> | null | maximum number of iterations. Default is 10 * Math.log10(N) |
metric | function | <optional> | euclidean | metric defining the dissimilarity |
seed | Number | <optional> | 1212 | seed value for random number generator |
- Source
- See
- https://link.springer.com/chapter/10.1007/978-3-030-32047-8_16 Faster k-Medoids Clustering: Improving the PAM, CLARA, and CLARANS Algorithms
- To Do
- needs restructuring.
Returns:
- Type:
- KMedoids
Methods
_get_random_medoids(K)
Algorithm 3. FastPAM LAB: Linear Approximate BUILD initialization.
Parameters:
Name | Type | Description |
---|---|---|
K | number | number of clusters |
- Source
_iteration()
Algorithm 2. FastPAM2: SWAP with multiple candidates
- Source
get_clusters() → {Array.<Array>}
- Source
Returns:
- Array of clusters with the indices of the rows in given
matrix
.
- Type:
- Array.<Array>
init(K)
Computes K
clusters out of the matrix
.
Parameters:
Name | Type | Description |
---|---|---|
K | Number | number of clusters. |
- Source