Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rfm_package-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rfm_package-0.1.0-py2.py3-none-any.whl (3.1 kB view details)

Uploaded Python 2Python 3

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

Hashes for rfm_package-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a8077a437d9530201a7203eb829c2e29f102f13e474db72b55c4f9c9b2711813
MD5 4afa09b17e3e0dff02afa17e98f55ebf
BLAKE2b-256 f0022ca6209fb42f8f0166beeb3e188b9fd2b4d427057c78351b2a02810dbe1c

See more details on using hashes here.

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

Hashes for rfm_package-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ef85cc89c49cb36ae7dd886f0edf9e6261793f3b2ecd7bf2c2fab73c300c27a4
MD5 dd9aad61e2d491e82b06a11899059622
BLAKE2b-256 5df8f9b35172777eb49db1bb8ec05f7374dac438a20ee1a7eb77a3fd308baebf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page