from sklearn_extra.cluster import KMedoidsimport numpy as np# Create a sample datasetdata = 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 parametersk = 2kmedoids = KMedoids(n_clusters=k, random_state=0)# Fit the model to your datakmedoids.fit(data)# Get the cluster medoids and labelsmedoids = kmedoids.medoid_indices_labels = kmedoids.labels_print("Cluster Medoids:", medoids)print("Cluster Labels:", labels)