• This repository has been archived on 28/Jun/2024
  • Stars
    star
    1,446
  • Rank 32,448 (Top 0.7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lifetime value in Python

Measuring users is hard. Lifetimes makes it easy.

Inactively Maintained PyPI version Documentation Status Build Status Coverage Status

Read me first: Latest on the lifetimes project

๐Ÿ‘‹ This codebase has moved to "maintenance-mode". I won't be adding new features, improvements, or even answering issues in this codebase (but perhaps the occasional bug fix). Why? I don't use lifetimes anymore, nor do I keep up with the literature around RFM.

A project has emerged as a successor to lifetimes, PyMC-Lab/PyMC-Marketing, please check it out!

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.

More Repositories

1

Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
Jupyter Notebook
26,646
star
2

lifelines

Survival analysis in Python
Python
2,337
star
3

tdigest

t-Digest data structure in Python. Useful for percentiles and quantiles, including distributed enviroments like PySpark
Python
379
star
4

PyProcess

Generate stochastic processes using Python. Unfortunately not maintained any longer =(
Python
113
star
5

StartupFiles

My IPython startup files.
Python
109
star
6

Python-Numerics

Numerical machines in Python
Python
95
star
7

lifestyles

Work-In-Progress: conjoint analysis in Python
Python
52
star
8

lifelike

WIP predicted survival functions
Python
37
star
9

Graphical-Lasso-in-Finance

Implementations of the graphical lasso method to estimation of covariance matrices in finance.
Python
37
star
10

Subwayjs

make an interactive subway map in javascript.
JavaScript
33
star
11

decision-weights

Homegrown analysis of Prospect Theory: Math, turkers and python =)
Python
33
star
12

PyconCanada2015

My scrapers, data and analysis for PyCon Canada 2015 Keynote
Python
26
star
13

PyDataNY_2019_tutorial

Repo for PyData 2019 Tutorial - New Trends in Estimation and Inference
Jupyter Notebook
26
star
14

demographica

Analyse US name distributions and create age profiles of your users
Python
18
star
15

autograd-gamma

NotImplementedError: VJP of gammainc wrt argnum 0 not defined
Python
15
star
16

PasswordAnalysis

This is a description of human-created passwords using markov models
Python
14
star
17

dog

a simple casual graph evaluator (for experiments)
Python
13
star
18

McData

Repo for data surrounding fast food nutrition and ingredients
Python
10
star
19

SMS_Terminal

Turn your Android into a SMS-based terminal line using Python!
Python
8
star
20

simpsons-paradox

use Python to detect Simpson's paradox
Python
7
star
21

The-Golden-Retrieber

A classification algorithm that classifies Justin Bieber in Twitter display pictures
7
star
22

lifelines-replications

Using lifelines to replicate published articles
Jupyter Notebook
6
star
23

compilers

HTML
5
star
24

python_packages_survey

Python
5
star
25

Playground

Some small scripts that I use
Python
3
star
26

pipp

recommendations after using pip, for PyCon Canada 2015
Python
3
star
27

spec_utils

Python
2
star
28

mIPython

Analyze your common IPython operations.
Python
2
star
29

tf-examples

my tf examples for now
Python
2
star
30

Twittxor

A web-based Twitter game!
Python
2
star
31

projecteuler-utils

utils for working on project euler (no solutions)
Python
2
star
32

heroes

heroes of the storm analysis
Jupyter Notebook
2
star
33

backwards_harmonic

Jupyter Notebook
1
star
34

yeast_counting

Python
1
star
35

coursera

coursera assignments
R
1
star
36

uoft-notes

Course notes for sessions of 2943 and 3030
1
star
37

permutations

Hacking on cycles and permutations
Jupyter Notebook
1
star
38

python-party

Automatically exported from code.google.com/p/python-party
Python
1
star
39

ipd

simple example of zero-determinant iterated prisoner's dilemma
Python
1
star
40

incubator

Python
1
star
41

set_loop

Python
1
star
42

ontario_demographica

Python
1
star
43

riddler-solutions

solution to fivethirtyeight's riddler problems
Python
1
star
44

eem_analysis

Python
1
star
45

demo-repo

This repo
Python
1
star