Lab 11 - HT
Lab 11 - HT
Home Task 1:
A company wants to segment its customers based on their Age, Annual Income, and Spending Score. The goal is
to group the customers into distinct segments to improve targeted marketing strategies. Your task is to apply K-
Means Clustering to segment the customers and evaluate the clustering quality using the Silhouette Score. What
is the optimal value of K in your case?
CODE:
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
# Convert to DataFrame
df = pd.DataFrame(data)
OUTPUT:
Discussion & Analysis of results
Why K=3?
Business Insight
Clustering Evaluation
Limitations
Sensitive to outliers
K-Means assumes spherical clusters
Conclusion
K-Means successfully segments customers using Age, Income, Spending Score.
Optimal K = 3 for this sample.
Silhouette Score is a good metric to evaluate cluster quality.