├── .gitignore ├── CLV_analysis_online_retail.ipynb ├── README.md └── input_data └── Online_Retail.xlsx /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | .idea/ 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | .static_storage/ 59 | .media/ 60 | local_settings.py 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints/ 77 | 78 | # pyenv 79 | .python-version 80 | 81 | # celery beat schedule file 82 | celerybeat-schedule 83 | 84 | # SageMath parsed files 85 | *.sage.py 86 | 87 | # Environments 88 | .env 89 | .venv 90 | env/ 91 | venv/ 92 | ENV/ 93 | env.bak/ 94 | venv.bak/ 95 | 96 | # Spyder project settings 97 | .spyderproject 98 | .spyproject 99 | 100 | # Rope project settings 101 | .ropeproject 102 | 103 | # mkdocs documentation 104 | /site 105 | 106 | # mypy 107 | .mypy_cache/ 108 | 109 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Customer lifetime value analysis 2 | We are modelling customer lifetime value for non-contractual business. 3 | 4 | ## Dependencies 5 | * pandas 6 | * numpy 7 | * scipy 8 | * matplotlib 9 | * seaborn 10 | * lifetimes 11 | * jupyter notebook 12 | 13 | ## Install Dependencies 14 | ``` 15 | Pandas: $ sudo pip install pandas 16 | numpy: $ sudo pip install numpy 17 | scipy: $ sudo pip install scipy 18 | matplotlib: 19 | $ sudo apt-get install libfreetype6-dev libpng-dev 20 | $ sudo pip install matplotlib 21 | seaborn: $ sudo pip install seaborn 22 | jupyter notebook: $ sudo apt-get -y install ipython ipython-notebook 23 | $ sudo -H pip install jupyter 24 | lifetimes: $ sudo pip install lifetimes 25 | 26 | ``` 27 | 28 | ## Dataset 29 | 30 | * Data set can be download from this [link](http://archive.ics.uci.edu/ml/datasets/online+retail) 31 | * There is no need to download dataset because it is already downloaded. 32 | * Path of dataset is `./input_data/` 33 | 34 | ## Usage 35 | Run the code given in ipython notebook `CLV_analysis_online_retail.ipynb` 36 | 37 | ## Credit 38 | Code credits for this code go to [Susan Li](https://github.com/susanli2016). I've merely created a wrapper and necessary changes to get people started. -------------------------------------------------------------------------------- /input_data/Online_Retail.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalajthanaki/Customer_lifetime_value_analysis/14fda31e5464b6191fea6fbe151a1af6cfca45d3/input_data/Online_Retail.xlsx --------------------------------------------------------------------------------