https://github.com/camdavidsonpilon/lifetimes
Lifetime value in Python
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 43 committers (4.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Lifetime value in Python
Basic Info
Statistics
- Stars: 1,464
- Watchers: 52
- Forks: 378
- Open Issues: 1
- Releases: 7
Topics
Metadata Files
README.md

Read me first: Latest on the lifetimes project
👋 This codebase has moved to "archived-mode". We won't be adding new features, improvements, or even answering issues in this codebase.
A project has emerged as a successor to lifetimes, PyMC-Lab/PyMC-Marketing, please check it out!
Measuring users is hard. Lifetimes makes it easy.
Introduction
Lifetimes can be used to analyze your users based on a few assumption:
- Users interact with you when they are "alive".
- 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
bash
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
Questions? Comments? Requests?
Please create an issue in the lifetimes repository.
Main Articles
- 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.
- 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
- Roberto Medri did a nice presentation on CLV at Etsy.
- Papers, lots of papers.
- R implementation is called BTYD (Buy 'Til You Die).
- Bruce Hardie's Website, especially his notes, is full of useful and essential explanations, many of which are featured in this library.
Owner
- Name: Cameron Davidson-Pilon
- Login: CamDavidsonPilon
- Kind: user
- Location: Waterloo, Canada
- Company: @Pioreactor
- Website: https://dataorigami.net
- Repositories: 90
- Profile: https://github.com/CamDavidsonPilon
CEO of Pioreactor. Former Director of Data Science @Shopify. Author of Bayesian Methods for Hackers and DataOrigami.
GitHub Events
Total
- Watch event: 26
- Fork event: 9
Last Year
- Watch event: 26
- Fork event: 9
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Cameron Davidson-Pilon | c****n@g****m | 264 |
| Anton Protopopov | a****v@g****m | 50 |
| Richard Hydomako | r****o@g****m | 27 |
| luke14free | l****l@p****m | 22 |
| Philippe Fanaro | p****o@g****m | 14 |
| Erik Vandeputte | e****k@n****m | 8 |
| Yanir Seroussi | y****i@g****m | 7 |
| statwonk | c****9@g****m | 6 |
| Anton Protopopov | a****v@g****m | 4 |
| github kyleyang | k****6@c****u | 3 |
| vruvora | v****8@g****u | 3 |
| Arnold Lin | c****t@a****h | 3 |
| Michael Schreier | m****r@g****e | 3 |
| Dani Garrido | d****o@g****m | 2 |
| Henry Hammond | h****2@g****m | 2 |
| Tim Finkel | t****m@T****l | 2 |
| Ilan Man | i****n@g****m | 2 |
| Ben Van Dyke | b****n@d****m | 2 |
| Utkarsh Gupta | u****7@g****m | 2 |
| Robert Enzmann | r****n@a****m | 2 |
| Adrien Marteau | a****u@f****m | 1 |
| Arnold Lin | a****n@p****m | 1 |
| Cameron Davidson-Pilon | c****p@C****l | 1 |
| Low, Zhi Hao | l****o@g****m | 1 |
| Jacky Ma | a****e@A****l | 1 |
| Harry Brundage | h****e@g****m | 1 |
| Chris Fournier | c****r@g****m | 1 |
| Eric Chiang | e****m@g****m | 1 |
| Rodney Keeling | r****g@g****m | 1 |
| Keshav Ramaswamy | k****y@i****m | 1 |
| and 13 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 169
- Total pull requests: 19
- Average time to close issues: over 4 years
- Average time to close pull requests: 21 days
- Total issue authors: 124
- Total pull request authors: 17
- Average comments per issue: 2.86
- Average comments per pull request: 2.21
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 0
- Average time to close issues: about 24 hours
- Average time to close pull requests: N/A
- Issue authors: 5
- Pull request authors: 0
- Average comments per issue: 1.8
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- SSMK-wq (5)
- CamDavidsonPilon (5)
- shaddyab (4)
- GrowthJeff (4)
- NudnikShpilkis (3)
- martingg92 (3)
- dmanhattan (3)
- jonimatix (3)
- psygo (3)
- hmikelee (3)
- Kara035 (3)
- MingCong18 (2)
- vruvora (2)
- clausherther (2)
- ahmadreza-smdi (2)
Pull Request Authors
- psygo (3)
- thomasburgess (2)
- CamDavidsonPilon (2)
- harrisong (2)
- orenshk (2)
- rahulshivan05 (2)
- meremeev (2)
- Arnoldosmium (2)
- sam-lupton (1)
- alonnir (1)
- utkarshgupta137 (1)
- ea-niibo (1)
- iRajMishra (1)
- lowzhao (1)
- Nicky027 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 318,854 last-month
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 28
(may contain duplicates) - Total versions: 46
- Total maintainers: 1
pypi.org: lifetimes
Measure customer lifetime value in Python
- Homepage: https://github.com/CamDavidsonPilon/lifetimes
- Documentation: https://lifetimes.readthedocs.io/
- License: MIT
-
Latest release: 0.11.3
published over 5 years ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/CamDavidsonPilon/lifetimes
- Documentation: https://pkg.go.dev/github.com/CamDavidsonPilon/lifetimes#section-documentation
-
Latest release: v0.11.3
published over 5 years ago
Rankings
proxy.golang.org: github.com/camdavidsonpilon/lifetimes
- Documentation: https://pkg.go.dev/github.com/camdavidsonpilon/lifetimes#section-documentation
-
Latest release: v0.11.3
published over 5 years ago
Rankings
conda-forge.org: lifetimes
- Homepage: https://github.com/CamDavidsonPilon/lifetimes
- License: MIT
-
Latest release: 0.11.3
published over 5 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/setup-python v1 composite
- autopep8 * development
- coveralls * development
- flake8 * development
- matplotlib * development
- pycodestyle * development
- pydocstyle * development
- pytest * development
- pytest-cov ==2.5.1 development
- pytest-mpl * development
- recommonmark *
- sphinxcontrib-napoleon *
- dill >=0.2.6
- numpy >1.10.0
- pandas >=0.24.0
- scipy >=1.0.0
- numpy >=1.10.0