Cluster Evaluation Metrics
📖 Scenario: You have grouped customers into clusters based on their shopping behavior. Now, you want to check how good these clusters are by comparing them to known customer groups.
🎯 Goal: Build a small program to calculate cluster evaluation metrics using sklearn. You will create true labels and predicted cluster labels, then compute the Adjusted Rand Index and Normalized Mutual Information scores.
📋 What You'll Learn
Create two lists:
true_labels and predicted_labels with exact valuesImport
adjusted_rand_score and normalized_mutual_info_score from sklearn.metricsCalculate
ari_score using adjusted_rand_score(true_labels, predicted_labels)Calculate
nmi_score using normalized_mutual_info_score(true_labels, predicted_labels)Print both scores with descriptive text
💡 Why This Matters
🌍 Real World
Cluster evaluation metrics help businesses check if their customer groups or product categories are meaningful and useful.
💼 Career
Data scientists and analysts use these metrics to validate clustering results and improve machine learning models.
Progress0 / 4 steps