Skip to main content

fight-churn

1. What's New : Support for Python 3.9-3.12! (April 2025)

Fighting Churn With Data just got added support for Python 3.10, 3.11 and 3.12! This is in addition to the original supported python, 3.9.

Python 3.13 is still not supported due to shap, which doesn't have precompiled wheels for Python 3.13 yet.

Note: If you try to updgrade packages, you will need to run pip with --force-reinstall or you may get errors about numpy not being compiled with the current version.

Please file issues if you notice problems with any supported python version, 3.9-3.12.

2. Not So New Anymore : ChurnSim White Paper & Advanced Simulation (August 2023)

New ChurnSim White Paper

There is now a white paper describing the inner workings of the Fighting Churn WIth Data churn simulation program:

New Advanced Simulation

Do you want to try out Fighting Churn With Data techniques with a more realistic data set? Try the new simulation of a Customer Relationship Management (CRM) product! It contains many realistic features including: multiple product plans, multi-user customer accounts, multiple billing periods, valued actions, and more! With these features you can try out ALL the code listings in Fighting Churn With Data and experience a great new challenge on your path to mastering churn.

To try the new simulation follow the setup instructions and add the argument --config-name crm5 to the churnsim.py command line, or set the argument schema='crm5' to the function run_standard_simulation if you are running the simulation from a package installation. The simulation will take an hour or so on a typical computer and produce around 30GB of data in your PostgreSQL database. See the Setup Instructions for more details.

3. What is this repository?

This is code for the book "Fighting Churn With Data: Science and strategy for keeping your customers"; the book serves as a detailed guide to the code. You can get more information at:

This page contains the most up to date setup instructions.

4. Setup Instructions

WARNING TO PYPI USERS: None of the internal links in this document work on the pypi.org website! To use the internal links in this README view it on github.

Note from the Author

Before you can load data or run the code you have to do some setup on your system. If you never have done this before it may seem like a lot of work, and it kind of is, but this amount of setup is routine when you begin to work with a new technology. These setup instructions should work for most people using either shell Python, Jupyter Notebook, or an IDE, on either Mac or Windows. That said, I must apologize because I am neither an expert in PostgreSQL nor an expert in Python, but I am about to give a lot of advice on how to setup and use these technologies - if you find I am not doing things the best way, or just not how you would have done it, please be patient. If you want to make things better please help help out! :)

Pre-Requisite Setup

Python and PostgreSQL are required.

Code Setup

After the pre-requesisites, you have a choice on how to run the Fighting Churn With Data Code:

  • Command Line Setup : The fastest and easiest way to get started, using a pip Python package installation. This is great if you want to run the code and see the output, but you do not want to change the code or run it line by line.
  • Jupyter Notebook Setup : This is another way to get started quickly, if you already have Jupyter Notebooks installed.
  • Developers IDE Setup : This method takes more time, but allows you to run the code line by line in a debugger, or change it. (If you are a professional developer planning to really use the code for your company, this is for you.)

5. Errata for the 1st Printing

This version of the README is for the the code released with the fightchurn pip package in September 2021. In this version there have been some modifications to the paths described in the first printing of Fighting Churn With Data to enable packaging the Python code. The following two differences summarize the changes:

  • To run the code listings, the first printing of the book refers to the script
    fight-churn/listings/py/run_churn_list.py : the path in the current code is fight-churn/fightchurn/run_churn_listing.py
  • To generate the data, the first printing of the book refers to scripts under fight-churn/data-generation/ : the path in the current code is fight-churn/fightchurn/churnsim

Complete details of the errata are described here.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Metadata

Release files for fightchurn 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fightchurn 1.2.0
File Size Uploaded
fightchurn-1.2.0.tar.gz 75.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fightchurn 1.2.0
File Interpreter ABI Platform
fightchurn-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 224.0 kB

Release files / fightchurn-1.2.0.tar.gz

Download URL fightchurn-1.2.0.tar.gz
Size 75.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8aa732ae13153f4b32748b0c3db910f23a2655701a94405534187be21cebf380
BLAKE2b-256 checksum
How to use checksums
be6584160303e85f5e2a8a803a1100c77d919f3774194d8699e53c692f34e749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.18

Release files / fightchurn-1.2.0-py3-none-any.whl

Download URL fightchurn-1.2.0-py3-none-any.whl
Size 148.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a789731ab6be67b52adbb6d4717c373714f82f9d6c9ec1941ebe37aa530a159d
BLAKE2b-256 checksum
How to use checksums
40f7cb0f66d9fec9d8e530f11fe7c8d2709acb9f316e4efd2f6ecb436677b313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.18

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page