Zhijing Eu
1 min readSep 4, 2024

--

Glad you enjoyed the article. It seems like you have two questions :

Q1) How do we deal with scenarios where multiple transactions are made in relatively short time scales (e.g Many purchases in same day or hour)?

A1) Unfortunately there isn't a straightforward answer as the selection of time granularity depends on the nature of the business and transaction behaviour of the customer base. I suggest trying both daily vs hourly granularity on a smaller subset of your overall raw data to see if it makes a big difference or not of which customers fall into the top 10% of frequent buyers. Similar to the analysis of share prices, the question of whether to use daily vs hourly price movements depends on what you are trying to model. While this article shows how you can calculate the RFM metrics by hand, there are libraries such as Python Lifetimes https://lifetimes.readthedocs.io/en/latest/More%20examples%20and%20recipes.html#example-sql-statement-to-transform-transactional-data-into-rfm-data and Py MC Marketing https://www.pymc-marketing.io/en/stable/api/generated/pymc_marketing.clv.utils.rfm_summary.html that automate the time sampling and conversion of the transaction data into a RFM table by customer. From the docs, the definition of Frequency in these libraries is : "the COUNT OF DISTINCT TIME PERIODS the customer had a purchase in. So if using days as units, then it’s the count of distinct days the customer had a purchase on."

However do note that the more granular the time scale, the more computationally tedious it becomes and once you choose the time granularity, all other parts of the analysis need to be consistent ie Recency, Age and even Monetary Value

--

--

Zhijing Eu
Zhijing Eu

Written by Zhijing Eu

Hi ! I’m “Z”. I am big on sci-fi, tech and digital trends.

Responses (1)