ML Models for LTV Prediction: BG/NBD, Early Predictor, and Integration
Marketing budget flows to channels with high CAC, while customer retention drops — a classic scenario when there is no objective LTV assessment. Without an accurate model, you either underpay for valuable customers or overpay for those who will leave in a month. For example, an online store spends 40% of its budget on contextual ads, but the LTV from this channel is 30% lower than from organic traffic. Saving can reach 40% of the marketing budget with proper segmentation.
We solve this with custom ML solutions under a turnkey model: from data collection to integration with CRM and ad platforms. Our ML models for LTV prediction, including early predictors at days 7–30 after registration, achieve MAPE 25–40% and reduce CAC by 20–30%. Our track record includes 50+ implementations for e-commerce and SaaS with revenues from $10M.
How Mathematical Models Predict LTV
Contractual models (SaaS, subscriptions): a customer is either active or churned. The problem breaks down into:
- Churn prediction: probability of leaving each period
- Revenue prediction: payment amount if active
- LTV = Σ P(alive at t) × Expected_Revenue(t) × Discount_Factor(t)
Non-contractual models (e-commerce, retail): the customer does not announce churn. The classic approach is the BG/NBD model (Beta Geometric/Negative Binomial Distribution):
- Frequency model: transaction frequency = NBD
- Dropout model: probability of customer 'death' = Beta-Geometric
- Monetary value model: gamma-gamma model for average order value
The lifetimes library (Python) implements BG/NBD + gamma-gamma out of the box. Data required: customer_id, frequency, recency, T (customer age), monetary_value.
Step-by-Step BG/NBD Implementation
- Prepare data: for each customer, calculate frequency (number of repeat purchases), recency (time from last purchase to end of period), T (time from first purchase to end of period).
- Train the model:
from lifetimes import BetaGeoFitter; bgf = BetaGeoFitter(); bgf.fit(frequency, recency, T). - Estimate monetary value: use GammaGammaFitter for average order value.
- Predict LTV:
bgf.conditional_expected_number_of_purchases_up_to_time(t) * expected_monetary_value.
Fader, P. S., & Hardie, B. G. S. (2005). "A Note on Deriving the Pareto/NBD Model".
ML Approach: Direct Prediction
An alternative to probabilistic models is direct prediction of 12-month LTV via regression. Features:
- RFM for first 30/60/90 days after onboarding
- Acquisition channel (paid search, organic, referral)
- Cohort characteristics (season of acquisition)
- Behavioral: feature usage, session depth
- Segment: B2B vs. B2C, geography, company size
Algorithm: LightGBM Regressor with quantile loss for uncertainty. Metric: MAPE on holdout cohort (customers whose onboarding was 12+ months ago). Typical accuracy: MAPE 25–40% for 12-month forecast — sufficient for segmentation but not for precise CAC calculation. LightGBM regressor is 25–40% more accurate than probabilistic models.
Comparison of approaches:
| Criterion | BG/NBD + gamma-gamma | ML Regressor |
|---|---|---|
| Data | Only transactions | Any features |
| Interpretability | High | Medium (SHAP) |
| Accuracy (MAPE) | 40–60% | 25–40% |
| Flexibility | Low | High (early signals, external data) |
Example code for BG/NBD
from lifetimes import BetaGeoFitter bgf = BetaGeoFitter(penalizer_coef=0.0) bgf.fit(data['frequency'], data['recency'], data['T']) Why Early LTV Prediction Matters for Business
A key nuance: predicting LTV within the first 7–30 days after registration, when data is scarce. The early predictor uses:
- Onboarding completion rate
- Number of key actions in the first week (product activation)
- NPS score from the first survey
- Usage depth: number of modules/features
Random Forest with these features can classify 'whales' (high LTV) with Precision 60–70% as early as 7 days after registration. This is twice as fast as the standard approach based on 30-day data. Early segmentation enables Customer Success to focus on the right customers from day one.
Segmentation by LTV
LTV prediction → customer base segmentation:
| Segment | LTV percentile | Strategy |
|---|---|---|
| Champions | > 90th | VIP support, reference programs |
| High Potential | 70–90th | Proactive CS, upsell |
| Core | 30–70th | Automated nurturing |
| At Risk | < 30th | Watchlist, fit assessment |
Segments are reviewed quarterly or upon significant behavioral changes.
Marketing Spend Optimization
The primary use of LTV models is CAC optimization. In paid channels (Google Ads, Meta Ads), predicted LTV is passed as conversion value. Smart Bidding optimizes bids to maximize LTV, shifting budget to channels with the best LTV/CAC ratio. Cohort analysis by month and campaign shows which sources truly bring valuable customers, not just cheap ones. Savings on inefficient channels can reach 40%.
Model Monitoring
LTV is a long-term prediction, making fast validation difficult. Approaches:
- Shortened horizon validation: train on a 24-month cohort, predict 12-month LTV, compare with actuals after 12 months
- Relative ranking accuracy: absolute accuracy is less important than correctly ordering customers by LTV
- Early vs. final LTV correlation: how well 7-day LTV correlates with 12-month actuals
For segmentation, MAPE 30–40% is sufficient — the key is to rank customers correctly. For precise CAC calculation, aim for MAPE <25%.
What's Included
- Data audit (CRM, transactions, behavior)
- Model selection and calibration (BG/NBD, ML, or ensemble)
- Early predictor development
- Integration with CRM and ad platforms (Google Ads, Meta Ads)
- Documentation, dashboards, team training
- Post-deployment support (monitoring, retraining)
Timeline
- BG/NBD + gamma-gamma model from lifetimes: 2–3 weeks
- ML system with early predictor, monitoring, and integration: 10–14 weeks
Cost is calculated individually, based on data volume and integration complexity. Get a consultation — we will evaluate your project and propose a solution. Request LTV model development for your business. Contact us to select the optimal model for your data.







