Skip to main content

Customer Lifetime Value Prediction


PyPI version GitHub license


CLV Prediction Documents

Benchmark Results

Benchmarked against a naive baseline (avg order value x purchase frequency x horizon) on synthetic transaction data (381 customers, 1yr train / 30d holdout). Full methodology and numbers: docs/benchmark.md.

metric baseline CLV (default) CLV (tuned)
MAE (per customer) 139.50 213.89 199.87
RMSE (per customer) 232.53 1,105.77 965.22
Portfolio error (total predicted vs. actual) 319.4% 8.1% 19.5%

The naive baseline can look competitive per-customer, but the trained pipeline is dramatically more accurate at the portfolio/aggregate level — the level most CLV decisions (budgeting, cohort value) are actually made at. Hyperparameter tuning narrows the per-customer gap further, though it isn't guaranteed to improve the aggregate number since tuning optimizes each model's own loss, not portfolio-level total error.

This framework we generate 2 main predictive model per customer. First, Next Purchase (Frequency) Model will be trained. This model will help us to predict the day of nex purchases per customer Second, Customer Value Model will be trained. THis model will help us to predict what will be the amount of next purchases per customer. There will be customers can not be predicted by those models above because of lack historical informations. Those customers are NewComers. This platform allows us to predict NewComers' total lifetime values as well.

Installation

Tool can be used any other package by install it via pypi or git command

poetry add clv_prediction

OR

poetry add git+https://github.com/caglanakpinar/clv_prediction.git

Project layout

clv/
    docs/   
        - configs.yaml
        - test_parameters.yaml
    confgis.py
    dashboard.py
    data_access.py
    executor.py
    functions.py
    main.py
    newcomers.py
    next_purchase_model.py
    next_purchase_prediction.py
    purchase_amount_model.py
    utils.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clv_prediction-0.4.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clv_prediction-0.4-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file clv_prediction-0.4.tar.gz.

File metadata

  • Download URL: clv_prediction-0.4.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for clv_prediction-0.4.tar.gz
Algorithm Hash digest
SHA256 69858dcf190a4922d9a60f7af14ce23e3ae1959f3009d5a5c0379d1908e7edaf
MD5 1cf7ecd35452ed6e188e8a7ec5107531
BLAKE2b-256 2d9841ce2fe62b7d7487db6ff15c68bbeb748c9bc100bf19cb922808d4e3a187

See more details on using hashes here.

File details

Details for the file clv_prediction-0.4-py3-none-any.whl.

File metadata

  • Download URL: clv_prediction-0.4-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for clv_prediction-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 980684cac025be2433853d1e359d30e9e1017275cbe6a5e5a574c373f6459dac
MD5 37544525425d5e3e25ebbb2b3f657912
BLAKE2b-256 6d563973a0e4bc22e7a714f7e5f5645fb1689581e9d5092346ed2c31164fb20f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page