A comprehensive data mining project analyzing transactional data from an online retail store using machine learning techniques including customer segmentation, association rules, and classification.
This project performs exploratory data analysis and applies data mining techniques to the UCI Online Retail Dataset, containing ~540,000 transactions from a UK-based online store (December 2010 - December 2011).
- Analyze sales patterns and customer behavior
- Segment customers using RFM (Recency, Frequency, Monetary) analysis
- Discover product associations using Market Basket Analysis
- Build predictive models for customer classification
| Method | Description | Purpose |
|---|---|---|
| PCA | Principal Component Analysis | Dimensionality reduction for visualization |
| K-Means | Clustering algorithm | Customer segmentation |
| Apriori | Association rules mining | Product recommendations |
| Random Forest | Ensemble classification | Customer segment prediction |
- Monthly sales trends and seasonality
- Top products by revenue
- Geographic sales distribution
- Customer activity over time
- Recency: Days since last purchase
- Frequency: Number of transactions
- Monetary: Total spending amount
- Frequent itemset mining with Apriori algorithm
- Association rules with support, confidence, and lift metrics
- Product pairing recommendations
- Random Forest classifier with temporal validation
- Silhouette score validation for clustering quality
Data-Mining-Project/
├── ProjektAED.ipynb # Main analysis notebook (EDA + Data Mining)
├── analiza_rfm.ipynb # Detailed RFM analysis with ML validation
├── OnlineRetail.csv # Dataset (UCI Online Retail)
├── pyproject.toml # Project dependencies
├── uv.lock # Dependency lock file
├── .python-version # Python version specification
├── LICENSE # MIT License
└── README.md # This file
- Python 3.12+
- uv package manager (recommended)
# Clone the repository
git clone https://github.com/Blazejost/Data-Mining-Project.git
cd Data-Mining-Project
# Install dependencies with uv
uv sync
# Or with pip
pip install matplotlib mlxtend pandas scikit-learn seaborn-
Run the main analysis notebook:
jupyter notebook ProjektAED.ipynb
-
Run the detailed RFM analysis:
jupyter notebook analiza_rfm.ipynb
pandas>= 3.0.0 - Data manipulationmatplotlib>= 3.10.8 - Visualizationseaborn>= 0.13.2 - Statistical visualizationscikit-learn>= 1.8.0 - Machine learning algorithmsmlxtend>= 0.24.0 - Association rules mining
- Cluster 0 (Regular): ~3,175 customers - Average engagement
- Cluster 1 (VIP): ~13 customers - High frequency & monetary value
- Cluster 2 (At-Risk): ~1,109 customers - Low recent activity
- Strong product associations found among decorative items
- Color variants of same products frequently purchased together
- Lift values up to 24x indicating strong positive correlations
| Attribute | Description |
|---|---|
| InvoiceNo | Invoice number (unique per transaction) |
| StockCode | Product code |
| Description | Product name |
| Quantity | Quantity purchased |
| InvoiceDate | Date and time of transaction |
| UnitPrice | Price per unit (GBP) |
| CustomerID | Customer identifier |
| Country | Country of customer |
This project is licensed under the MIT License - see the LICENSE file for details.
- Dataset: UCI Machine Learning Repository - Online Retail Dataset
- Dr. Daqing Chen, Director: Public Analytics group, London South Bank University