Using Loyalty Card Records and Machine Learning to Understand how Self-Medication Purchasing Behaviours vary Seasonally in England, 2012–2014


This paper examines objective purchasing information for inherently seasonal self-medication product groups using transaction-level loyalty card records. Predictive models are applied to predict future monthly self-medication purchasing. Analyses are undertaken at the lower super output area level, allowing the exploration of ~300 retail, social, demographic and environmental predictors of purchasing. The study uses a tree ensemble predictive algorithm, applying XGBoost using one year of historical training data to predict future purchase patterns. The study compares static and dynamic retraining approaches. Feature importance rank comparison and accumulated local effects plots are used to ascertain insights of the influence of different features. Clear purchasing seasonality is observed for both outcomes, reflecting the climatic drivers of the associated minor ailments. Although dynamic models perform best, where previous year behaviour differs greatly, predictions had higher error rates. Important features are consistent across models (e.g. previous sales, temperature, seasonality). Feature importance ranking had the greatest difference where seasons changed. Accumulated local effects plots highlight specific ranges of predictors influencing self-medication purchasing. Loyalty card records offer promise for monitoring the prevalence of minor ailments and reveal insights about the seasonality and drivers of over-the-counter medicine purchasing in England.

Applied Marketing Analytics