Skip to content

a7me3D/UK-Warehouse-Optimization-Analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UK Retail Data Analytics: Warehouse Optimization Pipeline

Project Overview

This project implements a comprehensive data analytics pipeline for UK retail transaction analysis with the goal of optimizing warehouse operations. The pipeline processes over 456,000 retail transactions to extract actionable insights for improving inventory management, customer service, and operational efficiency.

The analysis combines exploratory data analysis, statistical hypothesis testing, and customer segmentation to understand behavior patterns, product relationships, and operational opportunities. The findings are processed through GPT models to generate specific operational recommendations.


Project Structure

WarehouseOptimazation/
├── Data/
│   ├── online_retail_II.xlsx                # Raw retail transaction data
│   ├── uk_data_preprocessed.csv             # Processed UK retail data
│   └── ONSPD_FEB_2024_UK/                   # UK postcode classification data
├── Notebooks/
│   ├── 01_retail_eda.ipynb                  # Data loading and cleaning
│   ├── 02_uk_preprocess.ipynb               # UK-specific preprocessing
│   ├── 03_uk_postcode_populate.ipynb        # Populate UK postcode data
│   ├── 04_retail_categories_populate.ipynb  # Populate retail categories
│   ├── 05_hypothesis_testing.ipynb          # Statistical hypothesis tests
│   └── 06_customer_segmentation_model.ipynb # Customer segmentation analysis
└── README.md 

Analytics Pipeline

1. Data Preparation

  • Objective: Acquire and prepare retail transaction data for analysis.
  • Steps:
    1. Load raw Excel retail transaction data.
    2. Filter for UK transactions (primary market: 456,692 records).
    3. Handle missing values and check data consistency.

2. Exploratory Data Analysis (EDA)

  • Objective: Understand data characteristics and identify trends or anomalies.
  • Key Activities:
    • Identify outliers, missing values, and negative entries (returns or cancellations).
    • Examine customer volume distribution to find high-value customers.
    • Analyze product popularity and geographic concentration.
    • Assess temporal patterns in transactions for operational planning.

3. Feature Engineering

  • Objective: Transform raw data into features suitable for analysis and modeling.
  • Key Features:
    • Temporal: Day-of-week, weekend indicators, monthly aggregation, seasonal variables.
    • Customer Behavior: Purchase frequency, loyalty indicators, average order value, lifetime value.
    • Product Affinity: Market basket analysis to identify co-purchased products and category diversity.

4. Hypothesis Testing

  • Objective: Test business hypotheses to validate assumptions about customer behavior.
  • Hypotheses:
  1. Geographic Loyalty: Do urban and rural customers exhibit different loyalty patterns?
    Approach: Chi-square test for independence (with Fisher’s exact test as backup for small samples), because loyalty is categorical and these tests evaluate differences between groups.
    Result: No significant difference → geographic segmentation not required.

  2. Order Value by Geography: Do urban and rural customers spend different amounts per order?
    Approach: Mann-Whitney U test, chosen because order value is continuous but non-normal, and this test is robust to non-normal distributions.
    Result: No significant difference → uniform pricing strategy applies.

  3. Temporal Patterns: Do customers spend differently on weekends vs weekdays?
    Approach: Linear regression with log transformation to normalize skewed spending data and evaluate the effect of weekend/weekday.
    Result: No significant difference → consistent operational planning.

  4. Product Affinity Impact: Do customers buying high-affinity product pairs spend more?
    Approach: Market basket analysis (Apriori) combined with independent samples t-test, to identify product pairs and compare spending between customers who purchase high-affinity pairs versus others.
    Result: Significant increase (139% higher) → product affinity is important for strategy.

5. Customer Segmentation

  • Objective: Group customers for actionable strategies based on behavior.
  • Methodology:
    • K-means clustering on behavioral and product-affinity features.
    • RFM-based analysis (Recency, Frequency, Monetary) and additional behavioral features.
    • Determine optimal cluster number using Elbow and Silhouette methods.
  • Segments Identified:
    1. High-Frequency, High-Value, Diverse (13%): Premium customers needing VIP treatment.
    2. Medium-Frequency, Medium-Value, Moderate (46%): Core customer base.
    3. Medium-Frequency, High-Value, Moderate (11%): Valuable customers with specific preferences.
    4. Low-Frequency, Low-Value, Focused (30% combined): Cost-sensitive segments requiring efficiency.

6. GPT-Enhanced Recommendations

  • Objective: Translate analytical insights into operational guidance.
  • Applications:
    • Warehouse Layout: Place high-frequency or high-value products strategically.
    • Inventory Management: Allocate stock based on customer segment characteristics.
    • Marketing & Promotions: Design loyalty programs, cross-category promotions, and VIP campaigns.

Future Enhancements

  1. Advanced Analytics

    • Time series forecasting for demand planning.
    • Recommendation systems for cross-selling.
    • Real-time customer scoring and predictive lifetime value modeling.
  2. Operational Integration

    • Automated segment assignment for new customers.
    • Real-time dashboards for segment performance.
    • Integration with warehouse management systems and mobile apps for operational teams.
  3. GPT Enhancements

    • Custom model training on business-specific data.
    • Real-time recommendation updates from new transactions.
    • Multi-language support and scenario-based planning.

Summary

This project provides a structured, end-to-end analytics pipeline for UK retail data, combining data preparation, EDA, feature engineering, hypothesis testing, segmentation, and AI-powered recommendations. It enables actionable insights to optimize warehouse operations, inventory management, and customer engagement.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors