Aqib Ahmed
This project applies K-Means Clustering to segment customers of a retail store into distinct groups based on their Annual Income and Spending Score.
Customer segmentation is a key strategy in marketing and helps businesses:
- Identify different types of customers
- Create targeted marketing campaigns
- Design loyalty programs
- Personalize offers and discounts
- Name: Customer Segmentation Tutorial in Python
- Source: Kaggle Dataset
- File Used:
Mall_Customers.csv
Dataset Columns:
CustomerIDβ Unique customer IDGenderβ Male / FemaleAgeβ Age of the customerAnnual Income (k$)β Annual income in thousand dollarsSpending Score (1-100)β Spending score assigned by the mall
- Load the dataset using Pandas.
- Select features β
Annual Income&Spending Score. - Elbow Method β Determine optimal number of clusters (k).
- Apply K-Means Clustering with chosen k.
- Visualize clusters using scatter plots with centroids.
- Interpret customer groups.
Helps to choose the optimal number of clusters (k).
Clusters customers into groups such as:
- High Income β High Spending (Luxury Shoppers π)
- Low Income β Low Spending (Budget Customers π΅)
- High Income β Low Spending (Careful Customers π§)
- Medium Income β Medium Spending (Average Customers π)
- Low Income β High Spending (Impulsive Customers β‘)
- Python
- Pandas β Data handling
- Matplotlib / Seaborn β Visualization
- Scikit-Learn β K-Means Clustering
The K-Means algorithm successfully divided customers into 5 meaningful groups, helping the retail store better understand customer behaviors and design targeted strategies.
- Clone this repository:
git clone https://github.com/Aqibahmed12/PRODIGY_ML_2.git cd PRODIGY_ML_2 - Install dependencies:
pip install pandas matplotlib seaborn scikit-learn
- Run the notebook:
jupyter notebook Task-02_KMeans_Customer_Segmentation.ipynb