Development of a product pricing algorithm using RFM strategy for user cohorts using machine learning methods
Main Article Content
Abstract
This paper presents a comprehensive approach to developing a dynamic product pricing algorithm that integrates RFM (Recency, Frequency, Monetary) customer segmentation strategy with machine learning methods. The research addresses the critical challenge of personalizing pricing strategies for different user cohorts in competitive retail environments, particularly for supermarkets and online marketplaces. The study extends the classical RFM model by incorporating price elasticity of demand coefficients to create a cohort-based pricing framework. Using the K-Nearest Neighbors (KNN) algorithm, the authors developed an automated classification system that accurately segments customers based on their behavioral characteristics, achieving 100% classification accuracy for repeat purchasers. The methodology comprises five key stages: data collection and preprocessing, RFM score calculation using a quartile-based ranking, customer segmentation into five distinct groups (Champions, Loyal Users, Potential Loyalists, At-Risk, and Lost), training a machine learning model for segment prediction, and cohort formation based on the timing of the first purchase. The research implements a pricing algorithm that selectively applies discounts to target segments (“Potential Loyalists” and “At Risk” customers) who demonstrate inelastic demand and have maintained activity for at least six months. Experimental results demonstrate that strategic discount application not only reduces customer churn but also increases overall revenue through enhanced purchase volume. The proposed framework, implemented in the R programming language within the RStudio environment, provides businesses with a data-driven decision support tool for optimizing personalized pricing strategies while maintaining profitability. This approach enables companies to balance customer retention efforts with revenue maximization by utilizing sophisticated behavioral analytics and predictive modeling.

