8.15 Summary

In this exercise, we segmented customers in 4 groups based on their past purchase behavior. We used recency, frequency, and monetary value (RFM) to segment customers. K-means clustering led to 4 segments. Next we described the segments using customer demographics. Using random forest classifier, we found out that customer lifetime value and share of wallet are two critical metrics for segmenting customers.

library(knitr)
library(recommenderlab)
library(ggplot2)
library(dplyr)
library(here)