Customer Segmentation using Clustering
-
Upload
dessy-amirudin -
Category
Data & Analytics
-
view
46 -
download
1
Transcript of Customer Segmentation using Clustering
1
Confidential. © Stream Intelligence Ltd. All rights reserved.
Introduction to Clustering
2
Confidential. © Stream Intelligence Ltd. All rights reserved.
Agenda
1 Introduction: Business Case
2 Clustering
3 Hierarchical Clustering
4 K-means Clustering
3
Confidential. © Stream Intelligence Ltd. All rights reserved.
Business Case
1
4
Confidential. © Stream Intelligence Ltd. All rights reserved.
Business Case – Predicting Successful Music Production
Clustermusic A
Cluster music B
Clustermusic C
Clustermusic D
• Target is to appear at Billboard’s weekly to 40• Cost per single could up to 300K USD• Music Intelligence Solution using clustering to predict if a music will be
accepted by market• Increase success rate from 1 out of 10 to 8 out of 10
5
Confidential. © Stream Intelligence Ltd. All rights reserved.
Clustering
2
6
Confidential. © Stream Intelligence Ltd. All rights reserved.
Statistical Learning Categorization
Statistical Learning
Unsupervised Learning
Supervised Learning
Clustering Predictive Model
7
Confidential. © Stream Intelligence Ltd. All rights reserved.
Clustering
• Process of grouping a set of physical or abstract objects into clusters (example: customer, product etc.)
• A cluster is a collection of data objects that are similar to one another within the same cluster and are dissimilar to the objects in other clusters
• Similarity is calculated based distance between point
• Common distance measure is Euclidian distance
8
Confidential. © Stream Intelligence Ltd. All rights reserved.
Hierarchycal Clustering
2
9
Confidential. © Stream Intelligence Ltd. All rights reserved.
Hierarchical Clustering
• Start with each data point in its own cluster
10
Confidential. © Stream Intelligence Ltd. All rights reserved.
Hierarchical Clustering
• Combine two nearest clusters (Euclidian, Centroid)
11
Confidential. © Stream Intelligence Ltd. All rights reserved.
Lets Practice
• The data for this exercise was downloaded from www.movielens.org• Open “clustering_movie.R”• The movies in the dataset are categorized as belonging to different gender:
a. Actionb. Comedyc. Sci-Fid. etc.
12
Confidential. © Stream Intelligence Ltd. All rights reserved.
Dendogram
Heights represent the distance between point/cluster
13
Confidential. © Stream Intelligence Ltd. All rights reserved.
Finding Meaningful Cluster
• How to see which cluster have the most action movies? use this command:
tapply(movies$Action, clusterGroups, mean)
• Exercise: Can you find the characteristic of each cluster? Hint:
- Add the cluster as one of the variable in the data- Load dplyr library- Use aggregate and summarise function
14
Confidential. © Stream Intelligence Ltd. All rights reserved.
Common scenario
Tips:- Normalize the data
Movie Action Romance Rating Revenue (in USD)
A 1 1 5 200B 0 1 4 150C 0 0 3 50D 1 1 4 120
15
Confidential. © Stream Intelligence Ltd. All rights reserved.
K-means Clustering
2
16
Confidential. © Stream Intelligence Ltd. All rights reserved.
K-Means Clustering
1. Group data into K-clusters by:a. Determining the k centroidb. Group the data points to the nearest centroid
2. Algorithm works by iterating between two stages until the data points converge
Objective : High Level Description
17
Suppose k=3
K-Means Illustrations
18
Iteration = 0
1. Start with random positions of centroids.
K-Means Illustrations
19
Iteration = 1
1. Start with random positions of centroids.2. Assign each data point to closest centroid
K-Means Illustrations
20
Iteration = 1
1. Start with random positions of centroids.2. Assign each data point to closest centroid3. Move centroids to center of assigned
points (recalculating C)
K-Means Illustrations
21
Iteration = 3
1. Start with random positions of centroids.2. Assign each data point to closest centroid3. Move centroids to center of assigned
points4. Iterate till minimal cost
K-Means Illustrations
22
Iteration = 3
1. Start with random positions of centroids.2. Assign each data point to closest centroid3. Move centroids to center of assigned
points4. Iterate till minimal cost
What potentially can go wrong?
23Optimum Number of Cluster Illustrations
TSS = Total Sum of Square ErrorK = Number of cluster
Optimum Number of Cluster
24
Confidential. © Stream Intelligence Ltd. All rights reserved.
Lets Practice
• We will use the credit card profile data (cc-profile.csv)• Open “segmenting_customer.R”
Exercise:• What is the optimum number of cluster?• Please provide the characteristics of segment. Do you think it is meaningful?