← Back to all products

Customer Lifetime Value + Recommendations Accelerator

$2490

CLV pipeline for subscription/energy retail: acquisition cost, payment behavior, forward profitability, NPV-based CLV, and renewal recommendations by value tier.

18 filesv1.0.0
PythonMarkdownSQLYAMLJSONDatabricks

Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

⚙ Try Demo Tools

File Structure 18 files

clv-recommendations-accelerator/ ├── LICENSE ├── README.md ├── conftest.py ├── databricks.yml ├── guide/ │ ├── 01_what-you-get.md │ ├── 02_getting-started.md │ ├── 03_architecture.md │ └── 04_support.md ├── guides/ │ └── clv-methodology.md ├── lib/ │ └── clv.py ├── resources/ │ └── jobs.yml ├── src/ │ ├── 01_customer_acquisition_cost.sql │ ├── 02_payment_behavior_score.sql │ ├── 03_estimated_profitability.sql │ ├── 04_customer_lifetime_value.sql │ └── 05_renewal_recommendations.sql └── tests/ └── test_clv.py

Documentation Preview README excerpt

Customer Lifetime Value + Recommendations Accelerator

Calculates CLV for energy-retail / subscription customers and generates

personalized renewal recommendations prioritized by value tier. A 5-step SQL

pipeline: acquisition cost → payment behavior → forward profitability → NPV-based

CLV → renewal recommendations.

Fully generic and currency-neutral: map your customer, contract, and invoice

sources and configure channel costs + discount rate.

What's inside

  • Databricks Asset Bundle — a monthly CLV job (5 dependent SQL steps).
  • NPV CLV — CLV = ((profit + CAC) × (1-(1+r)^-n)/r) - CAC, with a

configurable monthly discount rate.

  • Renewal recommendations — High/Medium/Low/Negative tiers mapped to

retention actions, so spend goes where it pays back.

  • A dependency-free CLV library (lib/clv.py): CAC, payment behavior, credit

loss, profitability, NPV CLV, tiering, and recommendations — with an offline

test suite (6 tests).

Quickstart


pip install pytest && pytest tests/ -v
databricks bundle deploy -t dev -p <profile>

Provide the customer model + invoicing.f_invoice_payments, and set

discount_rate_monthly and channel costs.

License

MIT — see LICENSE.

Code Sample .py preview

conftest.py import os,sys sys.path.insert(0, os.path.dirname(__file__))