This project was built during the JunctionX Hackathon in collaboration with Antavo. We set out to explore how Explainable AI (XAI) can help identify the factors that best incentivize customers to spend more loyalty points.
Our goal was to provide data-driven insights into which rewards or incentives most effectively push customers to spend over 100 points in a transaction.
Using the data provided by Antavo, we discovered:
- Gift cards and the amount of bonus points a customer has are strong predictors of whether they will spend more than 100 points.
- The existence of a coupon code has a much smaller impact.
- Customers with more gift card balance are more likely to spend higher amounts of points.
- Data Sources
- events_junction.csv (main dataset used)
- rewards_junction.csv and activities_junction.csv were loaded but not integrated due to time constraints.
- Cleaning & Preparation
- Removed irrelevant or low-variance columns.
- Encoded categorical features (gift cards, coupon codes).
- Replaced NaNs with zeros and converted all fields to float where possible.
- Target variable: used_points (binary — whether more than 50 points were used).
- Train/Test Split
- ~90% training data
- ~10% test data
- Algorithm: Random Forest Regressor
- Hyperparameters: Default for max_depth and n_estimators (tuning showed minimal improvement).
- Explainability Tool: SHAP (SHapley Additive exPlanations) for feature importance and effect visualization.
We used SHAP to generate visual explanations:
- Summary bar plots to rank feature importance.
- Beeswarm and waterfall plots to show individual predictions.
- Scatter plots to visualize the influence of:
- properties.gift_card
- properties.bonus_points
- properties.coupon_code
These plots are hosted via a simple Flask app with minimal CSS, displaying 8 key figures exported from the notebook.
- Could not establish correlations between all datasets; only the largest table (events) was used.
- Current code is not flexible for integrating new datasets without manual rework.