Skip to page content
SAVRN
Search Plan a project

Open-weight model

ecommerce-churn-ltv-models

by Kicaulah Kicaulah/ecommerce-churn-ltv-models

ecommerce-churn-ltv-models is an open-weight model from Kicaulah, released under Creative Commons Attribution 4.0. Its published files total 13.4 MB.

Production-grade machine learning models for customer churn risk classification (forward 90-day inactivity) and customer lifetime value (LTV) regression (forward 180-day net spend), trained on the validated UCI Online Retail II dataset.

Parameters—
Context—
Weights13.4 MB
Licensecc-by-4.0
AccessOpen weights
Monthly Downloads—

Model Card

By Kicaulah, published under cc-by-4.0, revision fa326a253b07.

Production-grade machine learning models for customer churn risk classification (forward 90-day inactivity) and customer lifetime value (LTV) regression (forward 180-day net spend), trained on the validated UCI Online Retail II dataset. - Models were validated using strict temporal cohort splits across monthly cutoff dates (2010-03-01 through 2011-06-01). - Random K-fold splitting was strictly avoided to prevent temporal leakage and lookahead bias. Using cost-benefit scenario analysis on test cohort ($N=4,324$): - Unit Contact Cost ($c$): £2.50 - Retention Offer / Incentive ($d$): £15.00 - Customer Lifetime Value Recovered ($v$): £45.00 - Uplift / Success Rate ($u$): 15% (Base Scenario) The…

Read Kicaulah's full model card

E-Commerce Customer Churn & Lifetime Value Prediction Models

Production-grade machine learning models for customer churn risk classification (forward 90-day inactivity) and customer lifetime value (LTV) regression (forward 180-day net spend), trained on the validated UCI Online Retail II dataset.


1. Model Summary

Task Target Definition Model Architecture Key Test Metric Secondary Metric
Churn Risk Inactive for next 90 days ($Y=1$) Calibrated Logistic Regression (Isotonic) PR-AUC: 0.8185 ROC-AUC: 0.7721, Brier: 0.1786
Lifetime Value Net monetary spend over next 180 days Random Forest Regressor ($\log(1+y)$) Spearman: 0.5837 MAE: £615.11, $R^2$: 0.4623

Parsimony & Validation Strategy

  • Models were validated using strict temporal cohort splits across monthly cutoff dates (2010-03-01 through 2011-06-01).
  • Validation cutoff: 2011-02-01 to 2011-03-01.
  • Out-of-time test cutoff: 2011-04-01 to 2011-06-01 (4,324 customer-snapshots).
  • Random K-fold splitting was strictly avoided to prevent temporal leakage and lookahead bias.
  • Parsimonious design: Logistic Regression matched or exceeded gradient boosting architectures (LightGBM, XGBoost, CatBoost) on PR-AUC while offering superior probability calibration and interpretability.

2. Business Decision Threshold Optimization

Using cost-benefit scenario analysis on test cohort ($N=4,324$): - Unit Contact Cost ($c$): £2.50 - Retention Offer / Incentive ($d$): £15.00 - Customer Lifetime Value Recovered ($v$): £45.00 - Uplift / Success Rate ($u$): 15% (Base Scenario)

The expected net business value is maximized at threshold $ au^ = 0.52$: - Customers Targeted: 2,987 (69.1%) - True Positives Targeted: 2,548 - Gross Value Rescued: £17,203.24 - Net Business Value: £9,735.74 (vs default 0.50 net value £9,715.19) - Break-Even Required Churn Risk:* $ au_{ ext{break-even}} = rac{c}{u \cdot (v - d)} = rac{2.50}{0.15 \cdot 30.00} = 0.555$


3. 2x2 Customer Value & Risk Prioritization Matrix

Combining calibrated churn probabilities with predicted 180-day LTV segments customers into four operational tiers:

                  HIGH LTV (Top 20%)             LOW LTV (Bottom 80%)
           +-----------------------------+-----------------------------+
HIGH RISK  |  PRIORITY 1: Retain Urgently|  PRIORITY 3: Low-Cost Win   |
(P > 0.52) |  85 customers (1.97%)       |  3,001 customers (69.40%)   |
           |  £150,968 Value at Risk     |  £254,168 Value at Risk     |
           |  Action: Dedicated Outreach |  Action: Automated Discounts|
           +-----------------------------+-----------------------------+
LOW RISK   |  PRIORITY 2: Nurture Loyalty|  PRIORITY 4: Lifecycle Auto |
(P <= 0.52)|  780 customers (18.04%)     |  458 customers (10.59%)     |
           |  £1,817,449 Safe Future LTV |  £83,621 Safe Future LTV    |
           |  Action: VIP Programs       |  Action: Triggered Newslettr|
           +-----------------------------+-----------------------------+

4. How to Use the Models

import joblib
import pandas as pd
from huggingface_hub import hf_hub_download

# Download models
churn_path = hf_hub_download(repo_id="Kicaulah/ecommerce-churn-ltv-models", filename="churn_model.joblib")
ltv_path = hf_hub_download(repo_id="Kicaulah/ecommerce-churn-ltv-models", filename="ltv_model.joblib")

churn_pipeline = joblib.load(churn_path)
ltv_pipeline = joblib.load(ltv_path)

# Example customer snapshot feature row
customer_sample = pd.DataFrame([{
    "recency_days": 45,
    "tenure_days": 320,
    "tenure_censored": 0,
    "frequency_lifetime": 12,
    "purchase_days_lifetime": 9,
    "frequency_365": 10,
    "frequency_180": 4,
    "frequency_90": 1,
    "monetary_365": 2840.50,
    "revenue_180": 850.20,
    "revenue_90": 180.00,
    "historical_revenue_lifetime": 3400.00,
    "avg_order_value_365": 284.05,
    "avg_units_per_order_365": 42.0,
    "avg_lines_per_order_365": 14.5,
    "avg_days_between_purchases": 28.5,
    "std_days_between_purchases": 12.1,
    "max_gap_days": 65,
    "recency_to_avg_gap_ratio": 1.58,
    "active_months_365": 8,
    "product_diversity_365": 56,
    "category_diversity_365": 4,
    "below_ref_price_share_365": 0.08,
    "discount_line_share_365": 0.05,
    "return_value_rate_365": 0.03,
    "cancellation_rate_365": 0.02,
    "revenue_trend_90": -0.35,
    "order_trend_90": -0.20,
    "is_domestic": 1,
    "preferred_category": "Home & Decor",
    "country_group": "Domestic"
}])

# Inference
churn_prob = churn_pipeline.predict_proba(customer_sample)[:, 1][0]
predicted_ltv_180 = ltv_pipeline.predict(customer_sample)[0]

print(f"Calibrated Churn Probability: {churn_prob:.1%}")
print(f"Predicted 180-Day Net LTV:     £{predicted_ltv_180:,.2f}")

5. Model Interpretability & SHAP Analysis

Feature importance analyzed using TreeSHAP and KernelSHAP: - recency_days: Positively correlated with churn probability (as days since last transaction increase, historical non-return rate escalates). - recency_to_avg_gap_ratio: Strongest non-linear signal of behavioral departure. - monetary_365 & revenue_180: Strong positive association with forward 180-day LTV.

Note on causality: All SHAP attributions represent statistical associations identified by the models under observed transaction histories, not counterfactual causal proofs.


6. Privacy & Responsible AI

  • Customer Identifiers: Salted SHA-256 hashes (customer_id_hash).
  • Free-Text & PII: Invoices and descriptions are strictly sanitized; zero customer names, credit card numbers, or physical addresses are ingested or stored.
  • Licensing: The underlying dataset is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Identity and Version

Repository
Kicaulah/ecommerce-churn-ltv-models
Publisher
Kicaulah
Task
Not stated by the source
Modality
Other
Library
scikit-learn
Parameters
Not stated by the source
Languages
en
Revision
fa326a253b07cf074a113b31c08870e26ad347ef
First published
2026-10-04
Last updated
2026-10-04

Files and Weights

14 files, 13.4 MB in total.

Configuration4 files · 6.0 KB
Documentation1 file · 7.6 KB
Other8 files · 13.4 MB
Repository1 file · 1.7 KB
Every file
FileTypeSizeSHA-256
churn_metadata.jsonConfiguration1.4 KB —
ltv_metadata.jsonConfiguration1.1 KB —
threshold_optimal_decisions.jsonConfiguration1.1 KB —
validation_report.jsonConfiguration2.5 KB —
README.mdDocumentation7.6 KB —
churn_model.joblibOther44.4 KB afa327c3b8d3
figures/calibration_curve.pngOther90.3 KB —
figures/geographic_distribution.pngOther53.3 KB —
figures/roc_pr_curves.pngOther178.5 KB 0334684d79df
figures/segment_breakdown.pngOther127.3 KB 9cc7d2f22896
figures/shap_summary.pngOther117.9 KB 4d33f3692238
figures/threshold_optimization.pngOther99.4 KB —
ltv_model.joblibOther12.7 MB f7c958b6c9d6
.gitattributesRepository1.7 KB —

License and Download

License
cc-by-4.0
Access
Open weights, no gate
Download from Kicaulah

Released by Kicaulah through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) uci/online-retail-ii

Questions About ecommerce-churn-ltv-models

Can I use ecommerce-churn-ltv-models commercially?

Yes. ecommerce-churn-ltv-models is released under Creative Commons Attribution 4.0. CC BY 4.0 permits sharing and adapting the work, including commercially, provided the creator is credited and changes are indicated.