Customer Segmentation with K-Means Clustering and PCA


Businesses want to understand who their customers are so they can tailor products, marketing, and risk decisions. Segmentation turns a noisy customer base into a handful of actionable profiles.
I used the 2019 Survey of Consumer Finances, which captures household financial and demographic variables across the United States. The raw data is wide and messy, so the first step is selecting informative features and scaling them.
K-Means partitions data into K clusters by minimizing within-cluster variance. The key decisions are:
To visualize the clusters in 2D, I applied PCA and kept the first two principal components. PCA also helped reveal which variables carry the most variance.
The final app lets users:
Clustering is as much about interpretation as it is about the algorithm. The model is only useful once you can describe each segment in business terms.

ML-powered household segmentation dashboard using K-Means clustering and PCA to segment U.S. households from the 2019 Survey of Consumer Finances dataset, with an interactive Dash web application.

Full-stack machine learning application that predicts telecom customer churn using XGBoost and SHAP, with a React frontend and Django REST API for real-time insights.
Read
Comparing a classic TF-IDF + Logistic Regression pipeline against a fine-tuned BERT model for customer review sentiment classification.
Read
Learn how to deploy machine learning models with batch, real-time, streaming, and edge inference. Explore model serving, safe releases, monitoring, MLOps, security, and production best practices.
Read