A Python package for Recency, Frequency, Monetary model (RFM)
Project description
RFM Package
A Python package for Recency, Frequency, Monetary model (RFM), which is an analysis is a behavior based technique used to segment customers by examining their transaction history.
- how recently a customer has purchased (Recency)
- how often they purchase (Frequency)
- how much the customer spends (Monetary)
License
- Free software: MIT license
- Documentation: https://rfm-package.readthedocs.io.
Installation
You can install the package using
pip install rfm_package
Usage Test
orders = pd.read_csv(r'C:/Users/Admin/Desktop/RFM-Package/rfm_package/data/orders.csv', parse_dates = ['order_date'])
columns = create_rfm_columns(orders, "customer_id", "order_date", "revenue")
print(columns)
scaled = scale_rfm_columns(columns)
print(scaled)
plot_rfm(scaled)
scores = rfm_scores(scaled)
print(rfm_scores(scaled))
named_segments = give_names_to_segments(scores)
print(named_segments)
dist = segments_distribution(named_segments)
print(dist)
visualize_segments(dist)
Credits
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage
======= History
0.1.0 (2022-12-15)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
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 rfm_package-0.1.0.tar.gz.
File metadata
- Download URL: rfm_package-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8077a437d9530201a7203eb829c2e29f102f13e474db72b55c4f9c9b2711813
|
|
| MD5 |
4afa09b17e3e0dff02afa17e98f55ebf
|
|
| BLAKE2b-256 |
f0022ca6209fb42f8f0166beeb3e188b9fd2b4d427057c78351b2a02810dbe1c
|
File details
Details for the file rfm_package-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: rfm_package-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef85cc89c49cb36ae7dd886f0edf9e6261793f3b2ecd7bf2c2fab73c300c27a4
|
|
| MD5 |
dd9aad61e2d491e82b06a11899059622
|
|
| BLAKE2b-256 |
5df8f9b35172777eb49db1bb8ec05f7374dac438a20ee1a7eb77a3fd308baebf
|