One-line summary: Predict whether a customer will convert from a multi-channel digital marketing campaign, and identify the strongest conversion drivers.
This project uses a real-world digital marketing dataset to:
- understand what drives customer conversion, and
- predict conversion using two modeling approaches: Logistic Regression (interpretable baseline) and XGBoost (non-linear, higher performance).
Marketing teams run campaigns across channels (email, social, web, etc.), but often struggle to answer:
- Which customer behaviors and campaign attributes matter most for conversion?
- How accurately can we predict conversion using scalable modeling workflows?
- Rows: 8,000
- Columns: 20
- Target column detected: Conversion
- Class balance:
- 0: 12.35%
- 1: 87.65%
Columns:
CustomerIDAgeGenderIncomeCampaignChannelCampaignTypeAdSpendClickThroughRateConversionRateWebsiteVisitsPagesPerVisitTimeOnSiteSocialSharesEmailOpensEmailClicksPreviousPurchasesLoyaltyPointsAdvertisingPlatformAdvertisingToolConversion
Source: Kaggle – “Predict Conversion in Digital Marketing Dataset”
- Size: ~8,000 rows, ~20 variables
- Target: Conversion (1 = converted, 0 = not)
Put your dataset file here:
data/raw/digital_marketing_campaign_dataset.csv
Note: The original notebook used a local path; this repo structure makes it portable.
- Python
- PySpark (SparkSession, Spark DataFrames)
- Pandas / NumPy
- Matplotlib / Seaborn (EDA visuals)
- statsmodels (Logistic Regression with p-values)
- scikit-learn (split, metrics, cross-validation)
- XGBoost + GridSearchCV (tuning + feature importance)
- Null checks
- Dropped low-value identifiers (e.g.,
CustomerID) - Encoded categorical features (
CampaignChannel,CampaignType) via one-hot encoding - Train/test split (80/20), stratified on the target
We compare key behaviors between converters vs non-converters.
Example plots you can include in images/:
images/eda_previous_purchases.pngimages/eda_email_clicks.pngimages/eda_adspend.pngimages/eda_time_on_site.png
Sample (add your exported figures):
- Fit initial model with full feature set
- Backward elimination (drop insignificant variables step-by-step while monitoring test error)
- Evaluate with classification report, confusion matrix, and ROC-AUC
- GridSearchCV for hyperparameter tuning
- Evaluate with classification report + ROC-AUC
- Feature importance for interpretability
From EDA + modeling, the strongest signals of conversion are typically engagement and intent variables such as:
- EmailClicks / EmailOpens
- PreviousPurchases
- TimeOnSite
- PagesPerVisit
- ClickThroughRate / ConversionRate
- AdSpend
- Conversion-focused campaign type (vs awareness/retention)
Demographics (age, income) were comparatively less predictive in this dataset.
This repo is structured so you can store:
- Exported figures in
images/ - Saved models in
models/ - Final writeup or report in
reports/
Recommended outputs:
images/roc_logistic.pngimages/roc_xgboost.pngimages/xgb_feature_importance.pngreports/final_report.pdf
- Create environment
python -m venv .venv
source .venv/bin/activate # (Windows: .venv\Scripts\activate)
pip install -r requirements.txt- Place dataset
# Put the Kaggle CSV here:
data/raw/digital_marketing_campaign_dataset.csv- Open notebook
jupyter notebook notebooks/01_customer_conversion_pyspark.ipynbpython src/run_pipeline.py --data data/raw/digital_marketing_campaign_dataset.csv- Logistic Regression: strong interpretability, weaker detection of non-converters (class imbalance impact).
- XGBoost (tuned): better overall discrimination (higher ROC-AUC), stronger performance on imbalanced classification.
This project demonstrates a practical workflow to go from a multi-channel marketing dataset → EDA → interpretable baseline → tuned model → actionable insights.
customer-conversion-prediction/
├─ data/
│ ├─ raw/ # original dataset (not committed)
│ └─ processed/ # cleaned/encoded outputs (optional)
├─ notebooks/ # readable notebooks for learning
├─ src/ # reusable scripts (pipeline-style)
├─ images/ # figures used in README
├─ reports/ # final report / writeup
├─ models/ # saved models (optional)
├─ docs/ # extra documentation
├─ requirements.txt
└─ README.md
Course project: BAN 5600 – Advanced Big Data Computing and Programming (Clark University)
Dataset credit goes to the Kaggle dataset author.



