This project implements a K-Means clustering algorithm to group retail customers based on their purchase history, as outlined in Task-02. K-Means is an unsupervised machine learning algorithm designed to partition data into distinct clusters, where data points within each cluster exhibit higher similarity than those in different clusters.
The dataset used for this project can be accessed here- https://www.kaggle.com/datasets/vjchoudhary7/customer-segmentation-tutorial-in-python.
- Download the dataset from the provided link.
- Upload the files to a folder named Datasets in your Google Drive for easy access.
- Open Google Colab.
- Add a code cell in your Jupyter Notebook to mount your Google Drive.
The code for the implementation is located in the Customer_Segmentation.ipynb file. After completing the above steps, execute the code, which utilizes the Mall_Customers.csv file.
This project provided insights into various aspects of K-Means clustering:
-
Understanding K-Means Clustering:Gained a comprehensive understanding of the iterative process of K-Means, including cluster assignment and centroid updates to minimize within-cluster variance.
-
Feature Selection and Preprocessing: Learned the importance of selecting relevant features (e.g., annual income, spending score) and the significance of data preprocessing techniques such as scaling and normalization for effective clustering.
-
Optimal Cluster Determination: Explored methods like the Elbow Method to identify the optimal number of clusters (K), balancing model complexity and accuracy for meaningful customer segments.
-
Visualization and Interpretation: Developed skills in visualizing clustering results through scatter plots, enhancing the interpretation of distinct customer groups formed by K-Means.
-
Practical Implementation with Python: Strengthened practical skills in implementing K-Means using Python’s scikit-learn library and improved the ability to evaluate clustering performance through various metrics.