Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer Insights — Exploratory Data Analysis

A full exploratory data analysis (EDA) of a customer dataset: audit data quality, clean it, profile customer segments, quantify relationships, test a churn hypothesis, and tell the data story with clear visualizations. This is the day-to-day work of a data scientist — explore, find insight, communicate it.

⚠️ Uses synthetic data with deliberately embedded structure (so the insights are real and reproducible); works on any customer CSV via --csv.


🔍 What the analysis covers

  1. Data-quality audit — per-column dtype, missing values, uniqueness, and flags. Catches a real issue: a few impossible ages (−1, 0, 250).
  2. Cleaning — impossible ages → median imputation.
  3. Segment profiling — spend, tenure, engagement, and churn by segment.
  4. Correlation analysis — relationships among age, tenure, spend, engagement.
  5. Hypothesis test — does higher engagement reduce churn? (Churn by quintile.)
  6. Visualization — four presentation-ready charts saved to outputs/.

📊 Key findings (from the synthetic data)

Finding Evidence
Segments are distinct Premium avg spend $395 & churn 15% vs Budget $117 & churn 45%
Spend grows with tenure corr(tenure, spend) = +0.40
Engagement curbs churn corr(engagement, churn) = −0.26; lowest quintile churns 53% vs 17% for the highest

Recommendation: invest in early engagement to lift retention and lifetime value.

🖼️ Charts

spend tenure
corr churn

⚙️ Install & run

pip install -r requirements.txt

python examples/run_eda.py                     # synthetic data + charts + narrative
python examples/run_eda.py --csv customers.csv # your own data

✅ Validation

python tests/test_analysis.py

Confirms the audit detects bad ages, cleaning fixes them, segments are distinct, and the embedded relationships (tenure→spend positive, engagement→churn negative) are recovered.

🗂️ Project layout

src/
  data_loader.py   # CSV loader + synthetic customer generator
  analysis.py      # quality audit, cleaning, segment & correlation analysis
  plots.py         # presentation-ready charts
examples/
  run_eda.py       # full EDA pipeline with a written narrative of findings
outputs/           # generated charts
tests/
  test_analysis.py

🔭 Roadmap

  • Add a Jupyter notebook walkthrough with inline commentary
  • Build a churn-prediction model on the cleaned features
  • Interactive dashboard (Plotly / Streamlit)

Author: Dennis Chen (陳雲皓) · LinkedIn · GitHub

About

Exploratory data analysis of customer data — data-quality auditing, segment profiling, correlation analysis, churn drivers, and presentation-ready visualizations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages