Higgsfield DS Challenge — predictive churn system that distinguishes Voluntary Churn (user chooses to cancel) from Involuntary Churn (payment failures).
| Metric | Score |
|---|---|
| Macro F1 (OOF) | 0.5734 |
| Macro PR-AUC | 0.6269 |
| Accuracy | ~0.60 |
3-class classification: not_churned (50%) / vol_churn (25%) / invol_churn (25%)
Data → Feature Engineering → Models → Stacking → Calibration → Threshold Tuning → Submission
Properties — subscription start date, country, temporal features (year 1067 synthetic dates parsed as strings)
Purchases — total spend, purchase types, purchase velocity
Transactions — dual approach for failed tx (no user_id):
- Approach 1: Fingerprint matching (card_brand + bank + country + funding) between failed and successful transactions, weighted 1/N for multi-user fingerprints
- Approach 2: Card risk metadata from successful transactions (is_prepaid, cvc_check, country_mismatch)
Generations (5.5GB, read in chunks) — temporal patterns per user:
day01_ratio,burst_flag— captures "binge and leave" pattern for vol_churn- 14 ×
active_day_Xbinary flags (daily retention) first_quit_day,max_active_streak- Week1 vs Week2 trends (
gen_trend,credits_trend) - Recency features (
days_since_last_gen)
Quizzes — onboarding signals (source, frustration, experience)
Class-specific interactions:
prepaid_x_failure,payment_risk_score→ invol_churnburst_x_short_life,abrupt_decline→ vol_churnsustained_engagement,exploration_score→ engagement
- CatBoost GPU — native categorical handling,
TotalF1:Macroeval metric - LightGBM CPU — with target encoding for high-cardinality
country_code - XGBoost GPU — sample weighting for class balance
- Hierarchical 2-stage model:
- Stage 1: churned vs not_churned (binary)
- Stage 2: vol vs invol (binary, trained on churned subset)
- Combined:
P(vol) = P(churned) × P(vol|churned)
- Isotonic calibration per model before stacking
- Weighted average search across 4 models
- Per-class threshold tuning on OOF predictions (step=0.01)
- Burst pattern: vol_churn users generate heavily on day 0-1, then quit (median lifespan: 1.1 days!)
- High engagement → sudden drop:
gen_trendstrongly negative - Japanese users: 60% vol_churn rate (cultural signal?)
- Explore feature, leave unsatisfied
- Prepaid cards: 2x higher invol rate (10.3% vs 4.9%)
- Indian users: 46% invol rate (payment infrastructure issues)
- Turkey/Brazil: 32%+ invol rate
- card_declined: 97% of all failed transactions
- CVC not_provided → risky card signal
- Subscription plan = useless (exactly 50/25/25 across all 4 plans)
- MI max = 0.035 → weak individual signals, model finds patterns in combinations
- Day 2 re-engagement trigger — push notification/email if
day01_ratio > 0.8and silent on day 2 - Personal discounts when
gen_trend < -0.3(usage declining) - Feature education for users with
frustration = limited/high-cost - Premium content for power users (
gen_total > median) - Loyalty rewards on day 7 milestone
- Smart retry logic for
card_declined(97% of failures) - Pre-dunning notifications before card expiry
- Prepaid card warning — suggest credit alternatives at signup
- Grace period (3-7 days) before deactivation on failure
- Country-specific: Alternative payment methods for India/Turkey/Brazil
- Digital wallet promotion to reduce decline rate
SHAP TreeExplainer on CatBoost models (averaged across 5 folds).
- Global importance: Top features per class (
shap_global.png) - Per-user explanations: Top-5 SHAP values for each prediction
- Class-specific SHAP profiles: Different drivers for vol vs invol
Per-user probability scores available in submission_detailed.csv.
.
├── hacknu_pipeline_kaggle.ipynb # Main pipeline notebook
├── submission.csv # Test predictions (user_id, churn_status)
├── submission_detailed.csv # Predictions + probabilities + confidence
├── shap_global.png # SHAP global importance by class
├── business_insights.png # Behavioral analysis visualizations
└── README.md
- Upload dataset to Kaggle (or Google Drive for Colab)
- Update
DATA_ROOTpath in cell 3 - Select GPU accelerator (T4 / H100)
- Run all cells
Runtime: ~15-20 min on H100 / ~30-40 min on T4
Dependencies:
catboost, lightgbm, xgboost, optuna, shap, scikit-learn, pandas, numpy
- ML: CatBoost, LightGBM, XGBoost, Scikit-learn
- Explainability: SHAP
- Infrastructure: Kaggle Notebooks (H100 GPU)
- Languages: Python 3.10+
A 3-class classifier combining gradient boosting models (CatBoost/LightGBM/XGBoost) with a hierarchical 2-stage binary classifier. Features engineered across 6 data tables with emphasis on temporal patterns (burst detection, daily retention) and payment risk signals. Isotonic calibration and per-class threshold tuning applied for final predictions. SHAP-based explainability provides per-user churn reason attribution, enabling targeted retention strategies distinguishing voluntary (engagement-based) from involuntary (payment-based) churn.