Skip to content

Repository files navigation

Part 1: Data Audit, EDA & Business Understanding

This repository contains Part 1 of the D2C Customer Churn Intelligence & Retention API Capstone Project.

The goal of this part is to audit the raw data, perform exploratory analysis, and convert findings into actionable business hypotheses — before any machine learning model is built.


Repository Structure

d2c-churn-part1-eda-audit/
├── eda_audit.ipynb          # Full EDA notebook (data loading → churn hypotheses)
├── data_quality_report.md   # Data quality issues and treatment recommendations
├── business_memo.md         # Business-facing memo: what to investigate before campaigns
├── run_eda_code.py          # Standalone Python script that generates all charts/tables
├── outputs/
│   ├── charts/              # All saved chart PNGs (6 charts)
│   └── tables/              # CSV exports (missing, duplicate, outlier reports)
├── requirements.txt
└── README.md

Datasets Used

Place the downloaded dataset files in a folder named dataset/ one level above this repository (i.e., ../dataset/), or adjust RAW_DIR in the notebook/script.

File Description
customers.csv Customer demographics and profile
orders.csv Order-level transaction history
support_tickets.csv Customer support interactions
web_events_snapshot.csv 30-day web/app activity snapshot
churn_labels.csv Binary churn label for the next 60 days
intervention_history.csv Campaign/retention intervention history
rfm_modeling_snapshot.csv Pre-computed modeling snapshot

How to Run

1. Install Dependencies

pip install -r requirements.txt

2. Run the EDA Script (generates all charts and tables)

python run_eda_code.py

3. Open the Notebook

jupyter notebook eda_audit.ipynb

Key Outputs

Charts (in outputs/charts/)

Chart What It Shows
churn_dist.png Overall churn rate distribution
churn_by_loyalty.png Churn rate by loyalty tier
churn_by_age.png Churn rate by age group
spend_dist.png Distribution of total customer spend
tickets_vs_churn.png Support ticket count vs. churn
carts_vs_churn.png Abandoned carts vs. churn

Reports (in outputs/tables/)

  • missing_report.csv – Missing values per column per table
  • duplicate_report.csv – Duplicate row counts per table
  • outlier_report.csv – IQR-based outlier counts per numeric column

Churn-Risk Hypotheses (Summary)

  1. Loyalty Tier – Customers with no loyalty tier have significantly higher churn rates.
  2. Age Group – Younger customers (18–24) churn at a higher baseline rate.
  3. Support Tickets – Customers with multiple recent support tickets show elevated churn.
  4. Abandoned Carts – High abandoned-cart counts signal friction at checkout and predict churn.
  5. Low Spend / Infrequent Buyers – Customers with low lifetime spend have not formed a purchasing habit.

See eda_audit.ipynb for full evidence (charts, tables, and statistical support) behind each hypothesis.


Leakage Warning

The order_date > 2025-09-30 data and the churn_next_60d label column are excluded from all feature analysis. Only pre-snapshot data was used for EDA patterns.

About

Exploratory data analysis and data auditing for a D2C churn project. Focuses on cleaning the dataset, understanding customer behavior, finding patterns, and preparing insights for later retention and churn modeling stages.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages