An end-to-end data analytics and product strategy project that pivots a mid-sized Canadian airline's loyalty program from a reactive points-management system to a proactive, data-driven behavioral intelligence engine.
Historically, this airline relied on basic Customer Lifetime Value (CLV) and administrative cancellation metrics to track loyalty. This approach created a critical blind spot: high-value users drifted into inactivity undetected.
This project tackles that challenge by:
- Redefining Churn: Building a multi-factor behavioral anchor to catch "silent churners."
- Predictive Modeling: Deploying a Random Forest classifier (ROC-AUC: 0.966) to forecast churn susceptibility before it happens.
- Multidimensional Segmentation: Using K-Means clustering to identify 5 distinct, highly actionable customer personas based on flight velocity and engagement intensity.
- Product-Led Growth (PLG): Translating algorithmic outputs into a working Streamlit dashboard that provides marketing managers with exact retention playbooks for targeted cohorts.
├── Dashboard/
│ ├── app.py # The interactive Streamlit web application
│ └── master_final_segmented.csv # The scored and segmented dataset driving the UI
├── Initial_Datasets/
│ ├── Customer Loyalty History.csv # Raw demographic and enrollment data
│ └── Customer Flight Activity.csv # Raw transactional flight logs
├── Models_Output/
│ ├── feature_importances.png # Visual ranking of churn drivers
│ ├── ROC_Curve.png # Model evaluation metric
│ └── cluster_profiles.png # Summary of the 5 K-Means personas
├── src/
│ ├── phase1_data_cleaning.py # Defensive imputation and time-series aggregation
│ ├── phase2_target_definition.py # Engineering the multi-factor churn logic
│ ├── phase3_random_forest.py # Predictive modeling and feature extraction
│ └── phase4_kmeans_clustering.py # Multidimensional segmentation framework
├── Report/
│ └── Technical_Report.pdf # The comprehensive, LaTeX-typeset strategy document
└── README.md
- Merged multi-year operational datasets and handled missing demographic values (e.g., median-based salary imputation by education tier) to prevent algorithmic bias.
- Resolved pipeline artifacts by aggregating split-booking records, ensuring a strict "one row per customer-month" architecture.
Flagged users with zero flights and zero redemptions over a continuous 12-month period.
Protected active revenue by ensuring users who canceled a co-branded card but continued to fly were correctly labeled as Active.
- Trained a Random Forest Classifier with
class_weight='balanced'to correct for the 84/16 class imbalance. - Achieved:
- ROC-AUC:
0.966 - Recall:
97%
- ROC-AUC:
Feature importances proved churn is a behavioral problem, not a demographic one.
Months_FlownRedemption_Rate
far outweighed:
SalaryProvince
To overcome the "CLV Paradox"—where raw lifetime totals hide high-potential new members—an unsupervised K-Means clustering algorithm (k=5) was deployed using 10 engineered dimensions focused on velocity and intensity:
-
CLV & CLV_Per_Month
Total historical value vs. the rate of value generation. -
Tenure_Months
Total account age. -
Frequency_Penetration
Percentage of active months within a 24-month window. -
Engagement_Intensity
Average flights per month (calculated only for active months). -
Redemption_Rate
Fraction of earned points successfully burned. -
Recency_Months
Total months elapsed since the last flight. -
Demographics & Status
- Salary
- Loyalty Card Tier
-
Churn_Probability
Predicted risk score generated by the Random Forest classifier.
Based on these 10 dimensions, the 16,700-member base was grouped into the following actionable cohorts:
Highest-value, high-tenure corporate travelers who fly consistently and present near-zero churn risk.
Newer members with moderate value who are still establishing habits and are highly vulnerable to early-stage churn.
The massive volume engine; long-tenure customers with lower individual CLV but highly consistent flight patterns.
Previously high-value members who have not flown in months and require aggressive win-back campaigns.
The future VIP pipeline; brand-new members showing extremely high flight intensity right out of the gate.
Using the segmentation framework, we developed structural product interventions rather than relying on generic discount codes.
Deploy:
-
Zero-Friction Guarantees
- Example: 1-tap rebooking for delayed flights
-
Status Portability
- Example: gifting lounge passes
Goal: leverage loyalty for zero-CAC acquisition.
Drop Phantom Points upon signup.
Example:
5,000points with a60-day expiry
This leverages behavioral loss aversion to force the critical "first flight" habit.
Unlock In-Flight Micro-Burns.
Example:
- Redeem
500points for:- Wi-Fi
- Snacks
Benefits:
- Clears financial liability off the balance sheet
- Creates a recurring reward loop
Activate the Fast-Track Multiplier.
Example:
3xpoints for90 days
Goal: lock in momentum before their initial surge in travel fades.
Trigger:
- Algorithmic route-specific price alerts
- A
90-day"Prove It" status match challenge
based on historical flight patterns.
The final deliverable is a functional Streamlit interface that closes the gap between machine learning outputs and concrete business action.
It allows non-technical marketing managers to:
-
Filter the database by:
- Risk Level
- Persona
-
Instantly surface:
- targeted customer lists
- corresponding PLG retention strategies
git clone <repository-url>cd Dashboardpip install -r requirements.txt- streamlit
- pandas
- plotly
- scikit-learn
streamlit run app.py