from sklearn_extra.cluster import KMedoids
import numpy as np
 
# Create a sample dataset
data = np.array([[1, 2], [5, 8], [1, 5], [8, 8], [9, 10]])
 
# Initialize the K-Medoids model with the number of clusters (k) and other parameters
k = 2
kmedoids = KMedoids(n_clusters=k, random_state=0)
 
# Fit the model to your data
kmedoids.fit(data)
 
# Get the cluster medoids and labels
medoids = kmedoids.medoid_indices_
labels = kmedoids.labels_
 
print("Cluster Medoids:", medoids)
print("Cluster Labels:", labels)