BTYD#
READ FIRST: Project Status#
Development has transitioned to a new project repo: pymc-labs/pymc-marketing
Introduction#
BTYD is the successor to the Lifetimes library for implementing Buy Till You Die and Customer Lifetime Value statistical models in Python. All existing Lifetimes functionality is supported, and Bayesian PyMC model implementations are now in Beta.
BTYD can be used to analyze your users based on the following assumptions:
Users interact with you when they are active, or “alive”
Users under study may “die” or become inactive after some period of time
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
Installation#
BTYD installation requires Python 3.8 or 3.9:
pip install btyd
Questions? Comments? Requests?#
Please create an issue in the BTYD repository.
Supported Models#
- BG/NBD Fader, Peter S., Bruce G.S. Hardie, and Ka Lok Lee (2005a),
“Counting Your Customers the Easy Way: An Alternative to the Pareto/NBD Model”, Marketing Science, 24 (2), 275-84.
Gamma-Gamma Fader, Peter & G. S. Hardie, Bruce (2013). “The Gamma-Gamma Model of Monetary Value”.
- Modified BG/NBD Batislam, E.P., M. Denizel, A. Filiztekin (2007),
“Empirical validation and comparison of models for customer base analysis,” International Journal of Research in Marketing, 24 (3), 201-209.
Additional Information#
R implementation is called BTYDplus.
Bruce Hardie’s website, especially his notes, is full of useful and essential explanations, many of which are featured in this library.
Contents:
- User Guide
- RFM Data Format
- Basic Frequency/Recency analysis using the BG/NBD model
- Visualizing the Frequency/Recency Matrix
- Ranking customers from best to worst
- Assessing Model Fit
- Example Using Transactional Datasets
- More Model Estimation
- Customer Predictions
- Customer Probability Histories
- Estimating Customer Lifetime Value using the Gamma-Gamma model
- Model Persistence
- Generate RFM Summaries From a SQL Store
- API Reference
- Changelog