AI-Driven Health Scoring to Predict B2B SaaS Churn

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
AI-Driven Health Scoring to Predict B2B SaaS Churn
Medium
~2-4 weeks
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1357
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_logo-advance_0.webp
    B2B Advance company logo design
    646
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929

One of the most frequent Customer Success challenges is detecting at-risk key clients early enough. Traditional dashboards and manual CSM reviews often lag by 1-2 quarters. We propose building an ML-powered Customer Health Scoring (CHS) system that detects churn signals 90 days before actual departure. On one B2B SaaS project, prediction accuracy reached AUC 0.89, saving 15% of churn — equivalent to $1.2M annually for a mid-size SaaS provider. According to Gartner research, companies using AI for churn prediction reduce churn by 25% on average.

What Problems Does an ML CHS Model Solve?

Customer Health Score (CHS) is an integral metric of how engaged a client is with the product and how likely they are to renew or churn. For B2B SaaS and subscription services, it's a leading indicator of Net Revenue Retention (NRR). An ML approach shifts from CSM intuition to objective, reproducible assessment. The main problems solved:

  • Signal ambiguity: a drop in usage might be seasonal, not a churn signal. The ML model accounts for context.
  • Delayed reaction: manual reviews lag by 1-2 months, while the model works in real time, which is 2x faster.
  • Data silos: data from CRM, support, and product analytics are combined into a single pipeline.

Common rule-based system errors: they often miss complex signal combinations. For example, usage decline alone may not be dangerous, but combined with upcoming renewal and missing champion it becomes critical. ML models capture these non-linear interactions. The ML model is 1.3 times better than the best rule-based approach in 90-day churn prediction accuracy.

How ML Improves Customer Health Scoring

Signals for the Model

Product Usage:

  • DAU/WAU/MAU: activity of account's main users
  • Feature adoption: percentage of key features used in last 30 days
  • Depth of use: advanced vs. basic features
  • Stagnation: usage decline over last 4 weeks

Support & Success Signals:

  • Open tickets unresolved >3 days — negative signal
  • NPS, CSAT scores from last 6 months
  • Executive Business Review (EBR) held — positive signal
  • Escalations: complaints at management level

Commercial Indicators:

  • Renewal date proximity: <90 days → increased attention
  • Expansion or contraction in last 12 months
  • Invoice payment delays
  • Contract modification attempts

Relationship Signals:

  • Sponsor changes: champion left account — high risk
  • Multi-threading: number of contacts known by CSM (<2 = single-threaded)
  • Last meaningful interaction: days since last substantive conversation

Feature Engineering

def compute_customer_health_features(account_id, lookback_days=90):
    usage = get_product_usage(account_id, lookback_days)
    support = get_support_tickets(account_id, lookback_days)
    commercial = get_crm_data(account_id)

    return {
        # Usage trends
        'usage_trend_slope': np.polyfit(range(lookback_days), usage['daily_active_users'], 1)[0],
        'feature_adoption_score': len(usage['active_features']) / total_key_features,
        'power_user_ratio': usage['high_frequency_users'] / usage['total_seats'],

        # Support health
        'open_critical_tickets': support[support['priority'] == 'critical']['count'],
        'avg_resolution_time_days': support['avg_resolution_time'],
        'recent_nps': support['last_nps_score'],

        # Commercial
        'days_to_renewal': (commercial['renewal_date'] - today).days,
        'logo_expansion_12m': commercial['arr_change_12m'],
        'payment_delay_days': commercial['avg_payment_delay'],

        # Relationship
        'sponsor_change_6m': commercial['sponsor_changed_flag'],
        'contacts_known': commercial['known_contacts_count'],
        'days_since_last_call': (today - commercial['last_substantive_contact']).days
    }

Models and Architecture

Composite Score (rule-based baseline):

def rule_based_health_score(features):
    score = 100  # start at 100

    # Usage penalties
    if features['usage_trend_slope'] < -0.1:
        score -= 20
    if features['feature_adoption_score'] < 0.3:
        score -= 15

    # Support penalties
    if features['open_critical_tickets'] > 0:
        score -= 25
    if features['recent_nps'] and features['recent_nps'] < 7:
        score -= 15

    # Commercial risk
    if features['days_to_renewal'] < 60 and features['logo_expansion_12m'] < 0:
        score -= 20

    return max(0, min(100, score))

ML model on top: LightGBM or Logistic Regression trained on historical "renewed/churned" data after 12 months. Advantage over rules: captures non-linear interactions (e.g., usage decline alone is not risk, but combined with upcoming renewal becomes critical).

Temporal validation:

# Walk-forward: train on cohorts < 12 months ago, predict on later ones
# Metric: AUC on 90-day churn prediction
# Baseline: simply renewal date + last NPS

Why Automate CHS with AI?

Comparison of rule-based vs. ML on real data:

Characteristic Rule-based ML model
Accuracy (AUC) 0.70-0.75 0.85-0.90
Hidden risk detection 20% 55%
Adaptation time 1-2 days 1-2 weeks
Scalability Limited High

The ML model detects 35% more risks than rules, especially in scenarios with combined signals. On one project, 90-day churn prediction accuracy was 1.3 times higher than the best rule-based approach.

Risk Segmentation and Actions

Risk Tiers:

Level Score Action
Healthy 70-100 Quarterly check-in, expansion play
Attention 50-69 Monthly CSM review, fix pain points
At Risk 30-49 Schedule EBR, involve execs
Critical 0-29 Save playbook, consider concessions

Automated Playbooks:

def trigger_playbook(account, health_score, reason_codes):
    if health_score < 30:
        crm.create_task(owner='csm_manager', type='urgent_review', account=account)
        slack.notify('#csm-alerts', f"CRITICAL: {account.name} score={health_score}")
    elif health_score < 50 and 'usage_decline' in reason_codes:
        gainsight.enroll_in_playbook(account, 'activation_campaign')
    elif health_score > 80 and account.days_to_renewal < 90:
        crm.create_opportunity(account, type='expansion', amount=account.arr * 0.2)

Project Deliverables

Step Outcome
Data audit Report on available sources: CRM, product analytics, support
Feature pipeline ETL process for daily feature calculation
Rule-based score Baseline health score tuned to your product
ML model LightGBM training with walk-forward validation and threshold selection
Integration Connect to Salesforce/HubSpot, Gainsight/ChurnZero via API
Playbooks Automated triggers in CRM and Slack
Documentation Model description, metrics, CSM guide, training for your team
Access & Support 3-month post-deployment support with bi-weekly check-ins

Deliverables include: documentation (model description, metrics, CSM guide), access to the system (API, dashboard), training for your team, and 3-month post-deployment support with bi-weekly check-ins.

Our company has 5+ years of experience in AI/ML for Customer Success, having delivered 40+ projects for B2B SaaS companies ranging from $5M to $500M ARR. Our AI-driven Customer Health Scoring solutions have saved clients $500K annually on average, with an ROI of 5x. Implementation costs start at $20,000 for a basic CHS system.

Process

  1. Analytics: collect all available signals, identify data gaps.
  2. Design: define prediction window (90 days), choose metrics.
  3. Implementation: build feature pipeline, rule-based and ML models.
  4. Testing: walk-forward validation, compare to baseline.
  5. Deployment: integrate with CS tools, set up monitoring.

Timeline (Estimates)

  • Basic solution (feature pipeline + rule-based + CRM integration): 3 to 4 weeks.
  • Full solution (ML model + playbooks + Gainsight integration): 6 to 8 weeks.

Pricing starts at $20,000 for a basic implementation and scales based on data complexity and number of integrations. Contact us for a free data audit and project assessment.

Common CHS Implementation Mistakes

  • Ignoring relationship signals: a champion leaving is one of the strongest churn predictors but often overlooked.
  • Updating too infrequently: health score should be recalculated daily, not weekly.
  • Lack of feedback loop: the model must learn from CSM actions (whether client was saved or not).
More on quality criteriaWe guarantee transparent pipeline and certified specialists with 5+ years of AI/ML experience. Our team has delivered over 40 churn prediction models for B2B SaaS, with an average AUC improvement of 0.15 over rule-based systems.

To get started with our churn early warning system, request a consultation — we'll perform a data audit and propose the optimal solution. Our predictive health scoring identifies at-risk accounts, integrates health score with CRM systems, and provides a comprehensive B2B SaaS churn model using ML to reduce churn rate with AI. The system is designed for Customer Success automation and leverages ML for Customer Success.

Note: The above CHS system integrates seamlessly with your existing Customer Success automation tools.

When does a time series forecasting model fail in production?

The CFO requests a quarterly sales forecast. An analyst builds SARIMA on three years of data, achieves MAPE 8.3% on the test set, and deploys. Two months later, the metric in production jumps to 23%. The root cause: the model was trained on pre‑COVID data, tested on a stable period, but production hit a promotion and supply chain disruption. Data leakage plus distribution shift—perfect notebook numbers, a broken forecast in reality. We have seen this pattern dozens of times across retail, fintech, and IoT. Our team has delivered more than 50 forecasting projects over 5+ years.

Incorrect cross-validation. Standard train_test_split for time series creates data leakage: the model sees future values during training. The correct approach is TimeSeriesSplit or walk‑forward validation with an expanding window.

Multiple seasonality. Hourly electricity consumption has three seasonalities: daily (24h), weekly (168h), yearly (8760h). SARIMA handles only one. Prophet can handle multiple but scales poorly to thousands of series.

Missing values and anomalies. A missing sensor reading is information (the sensor turned off), not NaN. Linear interpolation destroys this signal. Proper handling depends on the missingness mechanism.

Cold start. A new SKU in a 50,000‑item assortment has no history, yet a forecast is needed. Standard approaches fail; cross‑learning or feature‑based methods are required.

Why is model selection critical for your data?

Prophet (Meta) – a solid start for business data with clear seasonality and holidays. Fast setup, interpretable, built‑in outlier detection. Fails on irregular patterns and does not scale beyond ~10k series without parallelization.

Gradient boosting on features (LightGBM, XGBoost) – often underestimated. Engineer lags (t‑1, t‑7, t‑28), rolling means, day‑of‑week, holidays. The model trains on all series simultaneously, solving cold start via transfer learning. MAPE in retail often beats neural nets with proper feature engineering.

TFT (Temporal Fusion Transformer) – a transformer designed for interpretable forecasting with covariates. Built‑in variable selection, temporal attention, quantile outputs. Available in pytorch‑forecasting. Requires ~10,000+ records per series for stable training.

PatchTST – splits the series into patches (like ViT for images), capturing local patterns better than classic transformers. Excellent for long‑horizon forecasting (96–720 steps ahead).

N‑HiTS, N‑BEATS – attention‑free neural architectures, faster than TFT, competitive accuracy. N‑BEATS won the M4/M5 benchmarks for tasks without covariates.

Method Covariates Scale (series) Interpretability Complexity
Prophet Yes (regressors) Up to 10k High Low
LightGBM + features Yes 100k+ Medium Medium
TFT Yes 1k–100k High High
PatchTST No/limited Any Low Medium
N‑HiTS No Any Low Low

How do we deploy TFT in production?

A typical pipeline via pytorch‑forecasting:

training = TimeSeriesDataSet(
    data,
    time_idx="time_idx",
    target="sales",
    group_ids=["store", "sku"],
    min_encoder_length=max_encoder_length // 2,
    max_encoder_length=max_encoder_length,  # 120 days
    min_prediction_length=1,
    max_prediction_length=max_prediction_length,  # 28 days
    static_categoricals=["store_type", "category"],
    time_varying_known_reals=["price", "promo_flag"],
    time_varying_unknown_reals=["sales"],
    target_normalizer=GroupNormalizer(groups=["store", "sku"], transformation="softplus"),
)

A common mistake: the default target_normalizer (StandardScaler) breaks predictions for series with zero values (no sales on weekends). GroupNormalizer with transformation="softplus" is the correct choice for count data.

Case study: retail demand forecasting

A chain of 120 stores, 8,000 SKUs, 28‑day forecast horizon. The original system: SARIMA per series, MAPE 18.4%, retraining cycle – 6 hours. We replaced it with TFT on PyTorch + pytorch‑forecasting: a single model for all series, MAPE 11.2%, retraining – 40 minutes on an A10G. Feature importance via variable selection revealed that day_before_holiday influences more than the holiday date itself. Annual savings on inference alone exceeded $50,000.

Step‑by‑step configuration

  1. Data collection and preparation. Handle missing values (mark NaN, interpolate only for technical failures), aggregate to required frequency, engineer covariates (holidays, promotions, prices).
  2. Create TimeSeriesDataSet. Set group_ids (store + SKU), time index, forecast horizon. Choose target_normalizer based on target distribution.
  3. Train a baseline. Prophet or LightGBM first – to understand complexity.
  4. Train TFT. Use TemporalFusionTransformer with loss=QuantileLoss(), tune learning rate and hidden layer sizes.
  5. Validate and interpret. Walk‑forward test, analyze variable selection, build attention heatmaps.

How to properly evaluate forecast quality?

RMSE alone is misleading – it over‑penalizes large values. Our standard set:

  • MAPE – interpretable, unstable near zero.
  • sMAPE – symmetric, avoids division by small numbers.
  • MASE (Mean Absolute Scaled Error) – normalized relative to a naive seasonal forecast, ideal for comparing series of different scales.
  • Pinball loss – for probabilistic forecasting, inventory management.
Metric When to use Drawback
MAPE Business reporting, series without zeros Unstable for small values
sMAPE Model comparison Asymmetric interpretation
MASE Multi‑scale series, benchmarks Needs seasonal naive baseline
Pinball loss Probabilistic models Multiple values for different quantiles

We guarantee a model card with these metrics on the validation set and walk‑forward results on at least 6 months of history.

What deliverables do you receive?

  • Documentation of chosen architecture and hyperparameter rationale.
  • Reproducible training and inference pipeline (Docker + CI/CD + Airflow/Prefect).
  • Committed code with unit tests for key components.
  • Team training: retraining, output interpretation, deployment of new versions.
  • 3 months of post‑delivery support (consultations, bug fixes, fine‑tuning).

The model is deployed via FastAPI or Triton Inference Server. Retraining is scheduled (e.g., weekly) via Airflow with drift validation and automatic rollback if metrics deteriorate.

Process and timeline

We start with EDA: visualization, ADF test, STL decomposition, analysis of missing values and outliers. This takes 2–3 days but often reveals systemic data issues that block forecasting. Then we build a baseline (naive seasonal, Prophet), engineer features for LightGBM, and select a neural architecture if needed. Walk‑forward validation with a realistic horizon. Deployment via API with automatic retraining scheduled via Airflow or Prefect.

Timeline: MVP forecast on one data type – 3–6 weeks. Hierarchical forecasting system with automation – 2–5 months. Cost is calculated individually based on data volume, number of series, and required accuracy.

Our team consists of certified ML engineers (AWS ML Specialty, GCP Professional ML Engineer) with 5+ years on the market and over 50 completed forecasting projects. Contact us for a free analysis of your data – we will assess the task and provide initial recommendations within 1–2 days. Request a consultation to ensure your forecasts work in production, not just in a notebook.