Skip to main content

Measure customer lifetime value in Python

Project description

Measuring users is hard. Lifetimes makes it easy.

PyPI version Documentation Status Build Status Coverage Status

Introduction

Lifetimes can be used to analyze your users based on a few assumption:

  1. Users interact with you when they are "alive".
  2. Users under study may "die" after some period of time.

I've quoted "alive" and "die" as these are the most abstract terms: feel free to use your own definition of "alive" and "die" (they are used similarly to "birth" and "death" in survival analysis). Whenever we have individuals repeating occurrences, we can use Lifetimes to help understand user behaviour.

Applications

If this is too abstract, consider these applications:

  • Predicting how often a visitor will return to your website. (Alive = visiting. Die = decided the website wasn't for them)
  • Understanding how frequently a patient may return to a hospital. (Alive = visiting. Die = maybe the patient moved to a new city, or became deceased.)
  • Predicting individuals who have churned from an app using only their usage history. (Alive = logins. Die = removed the app)
  • Predicting repeat purchases from a customer. (Alive = actively purchasing. Die = became disinterested with your product)
  • Predicting the lifetime value of your customers

Specific Application: Customer Lifetime Value

As emphasized by P. Fader and B. Hardie, understanding and acting on customer lifetime value (CLV) is the most important part of your business's sales efforts. And (apparently) everyone is doing it wrong (Prof. Fader's Video Lecture). Lifetimes is a Python library to calculate CLV for you.

Installation

pip install lifetimes

Contributing

Please refer to the Contributing Guide before creating any Pull Requests. It will make life easier for everyone.

Documentation and tutorials

Official documentation

Questions? Comments? Requests?

Please create an issue in the lifetimes repository.

Main Articles

  1. Probably, the seminal article of Non-Contractual CLV is Counting Your Customers: Who Are They and What Will They Do Next?, by David C. Schmittlein, Donald G. Morrison and Richard Colombo. Despite it being paid, it is worth the read. The relevant information will eventually end up in this library's documentation though.
  2. The other (more recent) paper is “Counting Your Customers” the Easy Way: An Alternative to the Pareto/NBD Model, by Peter Fader, Bruce Hardie and Ka Lok Lee.

More Information

  1. Roberto Medri did a nice presentation on CLV at Etsy.
  2. Papers, lots of papers.
  3. R implementation is called BTYD (Buy 'Til You Die).
  4. Bruce Hardie's Website, especially his notes, is full of useful and essential explanations, many of which are featured in this library.

Project details


Download files

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

Source Distribution

Lifetimes-0.11.3.tar.gz (559.8 kB view details)

Uploaded Source

Built Distribution

Lifetimes-0.11.3-py3-none-any.whl (584.2 kB view details)

Uploaded Python 3

File details

Details for the file Lifetimes-0.11.3.tar.gz.

File metadata

  • Download URL: Lifetimes-0.11.3.tar.gz
  • Upload date:
  • Size: 559.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for Lifetimes-0.11.3.tar.gz
Algorithm Hash digest
SHA256 15af22b130ed0cc6148d8ae4eb9b0f9c8c9bc9c952dd4ce68a1da0bc4c80c712
MD5 2b285c15773241f44d288b205b456f1b
BLAKE2b-256 b563a3262c94c4773440369dca99c2202fb0ffe3b5cff7d07837ab8862219180

See more details on using hashes here.

File details

Details for the file Lifetimes-0.11.3-py3-none-any.whl.

File metadata

  • Download URL: Lifetimes-0.11.3-py3-none-any.whl
  • Upload date:
  • Size: 584.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for Lifetimes-0.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 261e3dc89977c2b60767ca6728aaa29d429de0c814635070a749c36555895da8
MD5 f929a326a29c622c7e003b12ffdee1c9
BLAKE2b-256 c51fee6a471dcb5cb2f4dbc219023e07991f3b917875f9c8a5f5d77c00ddabca

See more details on using hashes here.

Supported by

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