Skip to content

This project performs **customer segmentation** for a mall using **K-Means clustering**, an unsupervised machine learning algorithm. The goal is to group customers based on **Annual Income** and **Spending Score** to help businesses design targeted marketing strategies.

Notifications You must be signed in to change notification settings

shanmukhsainandavarapu/Customer_knn

Repository files navigation

Customer Segmentation using K-Means Clustering

Project Overview

This project performs customer segmentation for a mall using K-Means clustering, an unsupervised machine learning algorithm.
The goal is to group customers based on Annual Income and Spending Score to help businesses design targeted marketing strategies.


Dataset

  • Source: Mall Customer Dataset
  • Features:
    • CustomerID
    • Gender
    • Age
    • Annual Income (k$)
    • Spending Score (1-100)
  • Target: None (unsupervised learning problem)

Workflow

  1. Data Loading & Inspection

    • Loaded CSV into a pandas DataFrame.
    • Checked for missing values and data types.
  2. Feature Selection

    • Chose Annual Income (k$) and Spending Score (1-100) for clustering.
  3. Feature Scaling

    • Standardized features using StandardScaler to improve clustering performance.
  4. Finding Optimal Clusters

    • Used the Elbow Method to determine the optimal number of clusters based on WCSS (Within-Cluster Sum of Squares).
  5. K-Means Clustering

    • Trained K-Means with the optimal number of clusters.
    • Assigned cluster labels to each customer.
  6. Visualization

    • Visualized clusters with different colors.
    • Marked centroids for clarity.
  7. Insights

    • Summarized characteristics of each cluster (average income, spending score, etc.).
    • Helps understand customer behavior for targeted marketing.

Libraries Used

  • pandas → Data handling
  • numpy → Numerical operations
  • matplotlib & seaborn → Visualization
  • sklearn → K-Means clustering and scaling

How to Run

  1. Clone the repository:
    git clone <your-repo-url>

About

This project performs **customer segmentation** for a mall using **K-Means clustering**, an unsupervised machine learning algorithm. The goal is to group customers based on **Annual Income** and **Spending Score** to help businesses design targeted marketing strategies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published