I have a dataset with 7 labels in the target variable.
X = data.drop('target', axis=1) Y = data['target'] Y.unique()
array(['Normal_Weight', 'Overweight_Level_I', 'Overweight_Level_II', 'Obesity_Type_I', 'Insufficient_Weight', 'Obesity_Type_II', 'Obesity_Type_III'], dtype=object)
km = KMeans(n_clusters=7, init="k-means++", random_state=300) km.fit_predict(X) np.unique(km.labels_)
array([0, 1, 2, 3, 4, 5, 6])
After performing the KMean clustering algorithm with a number of clusters as 7, the resulted clusters are labelled as 0,1,2,3,4,5,6. But how to know which real label matches the predicted label.
In other words, I want to know how to give original label names to new predicted labels, so that they can be compared like how many values are clustered correctly (Accuracy).