Skip to content

RamenMachine/Marketing-Analysis-ABTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Marketing A/B Test Evaluation Platform

Live Demo Python React TypeScript

A comprehensive data science platform for rigorous statistical A/B testing analysis

Combining advanced statistical methods, machine learning principles, and interactive data visualization


🎯 Overview

This project demonstrates expertise in data science, statistical analysis, and machine learning through a production-ready A/B testing evaluation platform. The system implements both Frequentist and Bayesian statistical approaches, providing robust analysis of marketing campaign effectiveness with comprehensive business intelligence metrics.

πŸ”¬ Key Highlights

  • Dual Statistical Frameworks: Frequentist hypothesis testing + Bayesian inference
  • Advanced Statistical Methods: T-tests, Chi-square, Bootstrap, Effect size, Power analysis
  • Bayesian Machine Learning: Beta-Binomial model with Monte Carlo sampling (100,000 samples)
  • Interactive Data Visualization: Real-time statistical analysis dashboard
  • Business Intelligence: ROAS, ROI, CPA, and scaling projections
  • Professional Documentation: Jupyter notebooks with mathematical formulas

πŸš€ Live Demo

πŸ‘‰ View Interactive Dashboard

Experience the full platform with interactive visualizations, real-time statistical analysis, and dynamic confidence interval adjustments.


πŸ“ˆ Statistical & Machine Learning Methods

Frequentist Statistical Analysis

Method Purpose Implementation
Two-Sample T-Test (Welch's) Tests for difference in means with unequal variances scipy.stats.ttest_ind()
Chi-Square Test Tests independence between group and conversion scipy.stats.chi2_contingency()
Bootstrap Confidence Intervals Non-parametric CI estimation (10,000 resamples) Custom implementation with NumPy
Effect Size (Cohen's h/d) Magnitude assessment independent of sample size Arcsine transformation for proportions
Statistical Power Analysis Probability of detecting true effects statsmodels.stats.power.TTestIndPower()

Mathematical Foundation:

  • T-statistic: $t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}$
  • Effect size: $h = 2 \times (\arcsin(\sqrt{p_1}) - \arcsin(\sqrt{p_2}))$
  • Power: $\text{Power} = 1 - \beta = P(\text{reject } H_0 | H_1 \text{ is true})$

Bayesian Machine Learning

Component Description Implementation
Beta-Binomial Model Conjugate prior for binary outcomes scipy.stats.beta with Beta(1,1) uniform prior
Posterior Distributions Full uncertainty quantification 100,000 Monte Carlo samples
Credible Intervals Probability-based uncertainty Percentile method from posterior samples
Probability of Superiority Direct probability statements $P(p_{\text{ad}} > p_{\text{psa}} \mid \text{data})$

Bayesian Inference:

  • Prior: $\text{Beta}(\alpha, \beta)$ where $\alpha = \beta = 1$ (uniform)
  • Posterior: $\text{Beta}(\alpha + \text{successes}, \beta + \text{failures})$
  • Posterior Mean: $E[p \mid \text{data}] = \frac{\alpha + \text{successes}}{\alpha + \beta + \text{total trials}}$

Advanced Analytics

  • Temporal Pattern Analysis: Day/hour effects using time series analysis
  • Dose-Response Analysis: Correlation between ad exposure and conversion (Pearson & Spearman)
  • Exploratory Data Analysis: Comprehensive data quality assessment
  • Scaling Projections: Revenue forecasting using statistical models

πŸ› οΈ Technology Stack

Data Science & Machine Learning

Category Technologies
Statistical Computing Python 3.8+, NumPy, SciPy, Statsmodels
Data Manipulation Pandas
Statistical Modeling SciPy.stats, Statsmodels.stats.power
Bayesian Inference Beta-Binomial model, Monte Carlo sampling
Data Visualization Matplotlib, Seaborn
Interactive Analysis Jupyter Notebooks

Frontend Development

Category Technologies
Framework React 18.2, TypeScript 5.0+
Build Tool Vite 5.0
Data Visualization Recharts 2.10
Styling Tailwind CSS, Glassmorphism UI
Icons Lucide React

Development Tools

  • Version Control: Git, GitHub
  • Package Management: npm, pip
  • Documentation: Markdown, LaTeX (for mathematical formulas)

πŸ“Š Project Structure

Marketing-Analysis-ABTest/
β”œβ”€β”€ πŸ““ Jupyter Notebooks (Data Science Analysis)
β”‚   β”œβ”€β”€ ab_test_eda.ipynb              # Exploratory Data Analysis
β”‚   β”œβ”€β”€ ab_test_frequentist.ipynb      # Frequentist Statistical Tests
β”‚   β”œβ”€β”€ ab_test_bayesian.ipynb         # Bayesian Machine Learning
β”‚   └── ab_test_business_impact.ipynb   # Business Intelligence Metrics
β”‚
β”œβ”€β”€ 🐍 Python Scripts (Statistical Analysis)
β”‚   β”œβ”€β”€ ab_test_eda.py                 # EDA automation
β”‚   β”œβ”€β”€ ab_test_frequentist.py         # Frequentist tests
β”‚   β”œβ”€β”€ ab_test_bayesian.py            # Bayesian inference
β”‚   └── ab_test_business_impact.py     # Business metrics
β”‚
β”œβ”€β”€ βš›οΈ React Frontend (Interactive Dashboard)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ ab_test_dashboard.tsx      # Main dashboard component
β”‚   β”‚   β”œβ”€β”€ main.jsx                   # Application entry point
β”‚   β”‚   └── index.css                  # Glassmorphism styling
β”‚   └── public/                        # Static assets & JSON results
β”‚
└── πŸ“š Documentation
    β”œβ”€β”€ README.md                      # This file
    β”œβ”€β”€ ab_test_prd.md                 # Product requirements
    β”œβ”€β”€ PROJECT_SUMMARY.md             # Executive summary
    └── docs/
        β”œβ”€β”€ STATISTICAL_METHODS.md     # Statistical methods guide
        └── DEPLOYMENT.md              # Deployment instructions

πŸ”¬ Statistical Analysis Workflow

graph TD
    A[Raw Data CSV] --> B[Data Quality Assessment]
    B --> C[Exploratory Data Analysis]
    C --> D[Frequentist Testing]
    C --> E[Bayesian Inference]
    D --> F[Statistical Results]
    E --> F
    F --> G[Business Metrics]
    G --> H[Interactive Dashboard]
    H --> I[Jupyter Documentation]
Loading

Analysis Pipeline

  1. Data Loading & Quality Checks

    • Missing value detection
    • Duplicate identification
    • Data consistency validation
  2. Exploratory Data Analysis

    • Conversion rate analysis
    • Temporal pattern identification
    • Dose-response relationships
    • Correlation analysis
  3. Statistical Testing

    • Frequentist: T-test, Chi-square, Bootstrap, Effect size, Power analysis
    • Bayesian: Beta-Binomial model, Posterior sampling, Credible intervals
  4. Business Intelligence

    • Incremental conversions
    • ROAS, ROI, CPA calculation
    • Break-even analysis
    • Scaling projections
  5. Visualization & Reporting

    • Interactive dashboard
    • Jupyter notebooks with formulas
    • Exportable results

πŸ“ˆ Key Metrics & Results

Statistical Metrics

  • P-value: Statistical significance testing
  • Effect Size: Cohen's h and d for magnitude assessment
  • Confidence Intervals: 90%, 95%, 99% (adjustable)
  • Statistical Power: Probability of detecting true effects
  • Probability of Superiority: Bayesian probability statements

Business Intelligence Metrics

  • ROAS (Return on Ad Spend): Revenue per dollar spent
  • ROI (Return on Investment): Net profit relative to investment
  • CPA (Cost per Acquisition): Cost per incremental conversion
  • Break-Even Analysis: Minimum performance thresholds
  • Scaling Projections: Revenue forecasts at different volumes

πŸŽ“ Data Science Skills Demonstrated

Statistical Analysis

  • βœ… Hypothesis testing (t-test, chi-square)
  • βœ… Bayesian inference (Beta-Binomial model)
  • βœ… Bootstrap methods
  • βœ… Effect size calculation
  • βœ… Power analysis
  • βœ… Confidence/Credible intervals

Machine Learning

  • βœ… Probabilistic modeling
  • βœ… Monte Carlo sampling
  • βœ… Posterior distribution estimation
  • βœ… Uncertainty quantification

Data Engineering

  • βœ… Data quality assessment
  • βœ… Temporal pattern analysis
  • βœ… Correlation analysis
  • βœ… Time series analysis

Data Visualization

  • βœ… Interactive dashboards
  • βœ… Statistical plots
  • βœ… Business metrics visualization
  • βœ… Real-time updates

πŸš€ Quick Start

Prerequisites

# Python 3.8+
python --version

# Node.js 16+
node --version

# npm
npm --version

Installation

# 1. Clone repository
git clone https://github.com/RamenMachine/Marketing-Analysis-ABTest.git
cd Marketing-Analysis-ABTest

# 2. Install Python dependencies
pip install pandas numpy scipy matplotlib seaborn statsmodels jupyter

# 3. Install Node.js dependencies
npm install

# 4. Run analysis (optional - generates JSON for dashboard)
python ab_test_eda.py
python ab_test_frequentist.py
python ab_test_bayesian.py
python ab_test_business_impact.py

# 5. Start development server
npm run dev

Running Jupyter Notebooks

jupyter notebook
# Open and run:
# - ab_test_eda.ipynb
# - ab_test_frequentist.ipynb
# - ab_test_bayesian.ipynb
# - ab_test_business_impact.ipynb

πŸ“š Jupyter Notebooks

Each notebook contains comprehensive analysis with:

  • Mathematical Formulas: LaTeX-formatted equations
  • Statistical Explanations: Step-by-step methodology
  • Code Implementation: Production-ready Python
  • Visualizations: Professional charts and graphs
  • Interpretations: Results explanation and recommendations
Notebook Focus Area Key Methods
ab_test_eda.ipynb Exploratory Analysis Data quality, temporal patterns, dose-response
ab_test_frequentist.ipynb Frequentist Statistics T-test, Chi-square, Bootstrap, Effect size, Power
ab_test_bayesian.ipynb Bayesian ML Beta-Binomial, Posterior sampling, Credible intervals
ab_test_business_impact.ipynb Business Intelligence ROAS, ROI, CPA, Break-even, Scaling

πŸ“Š Sample Analysis Output

Frequentist Results

  • T-statistic and p-value
  • 95% Confidence intervals
  • Effect size (Cohen's h/d)
  • Statistical power

Bayesian Results

  • Posterior distributions
  • 95% Credible intervals
  • Probability of superiority
  • Expected business impact

Business Metrics

  • Incremental conversions
  • ROAS and ROI
  • Cost per acquisition
  • Break-even analysis

🎯 Use Cases

  • Marketing Analytics: Evaluate campaign effectiveness
  • Product Development: A/B test new features
  • Data Science Research: Statistical methodology demonstration
  • Business Intelligence: Revenue attribution and forecasting
  • Academic: Statistical methods and machine learning

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘€ Author

RamenMachine


Built with ❀️ using Python, React, and advanced statistical methods

GitHub stars GitHub forks

About

Production-ready A/B testing platform: React 18 + TypeScript frontend with glassmorphism UI, Python statistical analysis backend (SciPy, Statsmodels). Dual statistical approaches (Frequentist & Bayesian), interactive visualizations, business metrics, and professional Jupyter notebooks with mathematical formulas.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors