K-Medoids is a clustering algorithm. Partitioning Around Medoids (PAM) algorithm is one such implementation of K-Medoids
- Scipy
- Numpy
from KMedoids import KMedoids
n_cluster
: number of clustersmax_iter
: maximum number of iterationstol
: tolerance level
data = [[2, 6], [3, 4], [3, 8], [4, 7], [6, 2], [6, 4], [7, 3], [7, 4], [8, 5], [7, 6]]
k_medoids = KMedoids(n_cluster=2)
k_medoids.fit(data)