Interpreting customer segments

In this section, we are going to discuss different ways to draw insights from the results of the previous clustering analysis. Let's first build a k-means clustering model with 4 clusters. You can use the following code:

# Interpreting customer segmentscluster <- kmeans(normalizedDF[c("TotalSales", "OrderCount", "AvgOrderValue")], 4)normalizedDF$Cluster <- cluster$cluster

As you can see from this code, we are fitting a k-means clustering model with 4 clusters, based on the three attributes: TotalSales, OrderCount, and AvgOrderValue. Then, we store the cluster label information into a DataFrame, normalizedDF. This DataFrame is shown in the following screenshot:

The first thing we are going to look at is the ...

Get Hands-On Data Science for Marketing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.