This project applies machine learning techniques to classify customers into different segmentation groups based on demographic and behavioural data. The workflow includes data preprocessing, feature engineering, model selection, hyperparameter tuning, and performance evaluation.
The project was developed as part of a university machine learning/data science assignment and focuses on building a complete end-to-end classification pipeline.
customer-segmentation-analysis/
├── README.md
├── requirements.txt
├── segmentation_pipeline.ipynb
├── Segmentation.csv
└── images/
└── segmentation_pipeline.png
The dataset contains customer information used to predict segmentation classes.
Main steps performed on the dataset:
- Data inspection and cleaning
- Missing value analysis
- Feature engineering
- Encoding categorical variables
- Feature scaling
- Handling class imbalance
- Train/test split preparation
- Python
- pandas
- NumPy
- scikit-learn
- XGBoost
- imbalanced-learn
- mlxtend
- matplotlib
- missingno
Dependencies are listed in requirements.txt.
- Missing value inspection
- Feature transformations
- Profession mapping
- New feature creation using co-occurrence information
- Scaling and encoding pipelines
Different machine learning models were evaluated to compare classification performance.
The selected model (XGBoost) was further improved through:
- Hyperparameter tuning
- Cross-validation
- Performance evaluation
The notebook includes:
- Accuracy and F1-score evaluation
- Classification reports
- Confusion matrices
- Learning curves
- Validation curves
The project demonstrates the complete process of developing a supervised machine learning pipeline for customer segmentation tasks.
Key outcomes:
- Built a reproducible ML workflow
- Compared multiple classification approaches
- Improved model performance through tuning
- Generated visual analyses and evaluation metrics
Add your pipeline image here:
git clone https://github.com/your-username/customer-segmentation-analysis.git
cd customer-segmentation-analysispip install -r requirements.txtjupyter notebookOpen:
segmentation_pipeline.ipynb
- This repository is intended for educational and portfolio purposes.
- The project was developed as part of a university assignment.
- Some preprocessing and modelling choices were made for experimentation and learning purposes.