SuRFM is a Python package for conducting RFM (Recency, Frequency, Monetary) analysis of customers. It provides tools for segmenting customers based on their transaction behavior and identifying high-value segments.
Project description
SuRFM: Surfing the Subscribers RFM
Group 6 - Marketing Analytics Project for Streaming Services
Project Objective
Our project aims to address the issue of declining customer retention and subscriber attrition in subscription-based companies, particularly in the context of streaming services. We propose the development of a Python package named SuRFM, leveraging RFM analysis to offer insights into behavior patterns, client segmentation, and their likelihood of churn.
Find our project on PyPi.
Read our documentation here.
How It Works
- Data Input: The SuRFM package requires subscription data, including subscriber activity and transaction history. If you want to run the package on your data, please visit csv_files/README.md to understand how the database should be updated.
- Analysis: The RFM model segments subscribers based on their recency, frequency, and monetary value contributions to the service.
- Insights and Actions: Based on the analysis, SuRFM provides actionable insights for improving customer retention strategies.
Step 1: Generate Data and Populate the Database
1. Data Generation Process
Navigate to the db folder within SuRFM. You'll find four files there. Begin by generating the data using the provided tools. Run the save_to_csv.py script to store the generated data in CSV format.
2. Database Construction
Execute the schema.py script to initialize the database. This action creates empty tables within subscription_database.db.
3. Data Population
To transfer the generated data from CSV files into the database, run the basic_rfm.py script. This step fills the tables in the database with the relevant information.
BONUS: Using Flake8 for Code Quality Checking
Introduction
Flake8 is a powerful tool for ensuring code quality and adherence to PEP 8 style guidelines in Python projects. It combines several tools in one package, including PyFlakes, pycodestyle (formerly known as pep8), and McCabe.
- It is added in the
requirenments.txt, yet you can install it with
pip install flake8
- For this project, run the project using the command to run on the whole project and see the errors on the terminal
flake8 --exclude __init__.py
- The path to file may be added in the end of the command if we need to run flake8 on specific part of the project
flake8 path/to/MA_GROUP_PROJECT/subdirectory/or/file
After this, with red the codes and explanations of the errors will be shown. Please check all of them and then push to the directory.
Additional Notes:
- Make sure to have Python installed on your system.
- Ensure all dependencies are met before executing the scripts.
- For any issues or inquiries, feel free to reach out to the repository maintainers.
Have a great time exploring the possibilities of our package! 📊✨
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file SuRFM-2.0.0.tar.gz.
File metadata
- Download URL: SuRFM-2.0.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89b76f054bc891ba072ba072211480336bb3a252955bda9d8dffbb75f17588e3
|
|
| MD5 |
9f0c958b74f8fa7200abd15468479544
|
|
| BLAKE2b-256 |
a201cfa1b1f691b38f8a7fb321eb54410a8b4b479681135381d4f3f6340c4a0d
|
File details
Details for the file SuRFM-2.0.0-py3-none-any.whl.
File metadata
- Download URL: SuRFM-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61aee635c308aa9539ddb270228b70ff65d3441d649286453f8d99823f50fcc3
|
|
| MD5 |
d23dc8f13faa2b3d0a7ed2c10703234a
|
|
| BLAKE2b-256 |
5f2b34b10d270812a91a860d3b84d228f3ed078c64317a141449dba1cfc05fef
|