Cluster Analysis란 (1)

Download Report

Transcript Cluster Analysis란 (1)

Cluster Analysis
(군집 분석)
0
Cluster Analysis란
(1) Primary Objective
: 사전에 고려된 변수들에 기초를 두고, 다양한 특성을 지닌 대상들을
상대적으로 동질적인 집단으로 분류하는 것
(2) Basic Principle
: High internal (Within-cluster) homogeneity
and high external (between-cluster) heterogeneity
군집내의 소비자들은 서로 유사하고 한 군집의 소비자는 다른 군집
의 소비자와 서로 다르게 군집을 선택한다.
1
(3) Application
ⅰ)
ⅱ)
ⅲ)
ⅳ)
ⅴ)
Market Segmentation /Benefit Segmentation
구매행동 이해 : 동질구매집단 분류를 통한 특성 파악
신제품 기회요인 도출 : brand와 Product를 clustering
Test market 선정
Data 축소
(4) Cluster Vs. Factor Analysis
cluster : 대상 분류
Factor : 변수(variable) 분류
(5) Cluster Vs. Discriminant Analysis - Object Classification
Cluster : Cluster나 Group에 대한 사전 정보(분류기준)가 없는 경우
(독립 관계 분석)
Discriminant : Cluster나 Group에 대한 사전 정보가 있는 경우
(종속 관계 분석)
2
Cluster Analysis 방법
Formulating the problem
Selecting a Distance Measure
Selecting a Clustering Procedure
Deciding on the Number of Clusters
Interpreting and Profiling Clusters
Assessing the Validity of Clustering
3
▣ Basic Concept
● An Ideal Clustering Situation
● A Practical Clustering Situation
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
Variable 2
Variable 2
4
(1) Formulating the Problem
: clustering의 기초가 되는 변수 선정
ⅰ) 군집되는 대상의 특성 분류
ⅱ) Cluster Analysis의 목적과 연결
(2) Similarity Measure
: Distance Measure가 주로 이용됨
(주어진 질문에 대해 대답 간 차이의 제곱의 합으로 계산)
① Euclidean distance
r
dijE = ∑ (Xik - Xjk)2 (k=1,.....r)
k=1
Xik : k차원에서 대상 i의 좌표
Xjk : k차원에서 대상 j의 좌표
5
Normalized distance function
: Raw data를 Normalization (Mean=0, Variance=1) 하여
scale상의 차이로 발생된 bias를 해결한 Euclidean distance
② Squared Euclidean distance
Dij = ∑(Xik - Xjk)2
i=1
An example of Euclidean distance between two objects measured on two variables – X and Y.
Y
●
(X2-Y2)
(Y2-Y1)
Object 1
●
(X1-Y1)
(X1-Y1)
X
Distance =
2
(X2-X1) + (Y2-Y1)
2
6
③ City-block distance (Manhattan distance)
r
dijc = ∑ Xik - Xjk
i=1
[문제점] ⅰ) 변수간에 correlation이 없다는 가정
ⅱ) Characteristic을 측정하는 단위(Scales)이 상이성이 가능
-------------------------------------------------------------Object Purchase
Commercial
Distance Citi-block
Probability(%) Viewing Time(min)
(min)
(second)
-------------------------------------------------------------A
60
3.0
AB
25.25
61
B
65
3.5
AC
10.00
153
C
64
4.0
BC
4.25
40
--------------------------------------------------------------
7
④ Mahalanobis distance
ⅰ) Standard Deviation으로 scaling해서 data 표준화
ⅱ) intercorrelation을 조정하기 위해서 within-group
variance-covariance 합산하는 접근 방식
ⅲ) 변수간에 서로 correlated 되었을 때 가장 적합
⑤ Minkowski distance
dijM = [∑(Xik - Xjk)p]1/r
8
(3) Clustering Algorithms
Clustering Procedures
Nonhierarchical
Hierarchical
Divisive
Hierarchical
Sequential
Threshold
Linkage
Methods
Variance
Methods
Parallel
Threshold
Optimizing
Partitioning
Centroid
Methods
Ward’s
Method
Single
Linkage
Complete
Linkage
Average
Linkage
9
1) 계층적 군집방법 (Hierarchical Cluster Procedure)
① Agglomerative Procedure
: 한 개의 대상에서 출발하여, 주위의 대상이나 cluster를 군집화하여
최종적으로 1개의 cluster로 만드는 방법
ⅰ) Single Linkage : minimum distance rule
군집이나 대상간의 최소거리로 군집화
ⅱ) Complete Linkage : maximum distance rule
ⅲ) Average Linkage
ⅳ) Ward's Method : W
● Within-cluster variance minimization rule
● Within-cluster distance의 전체 sum of square의 증가가 최소가
되게 cluster
ⅴ) Centroid Method
● 대상이나 cluster의 Centroid(mean)간의 거리 최소화
● 단점 : Metric data에만 적용 가능
10
② Decisive Method : 큰 한 개의 cluster로 부터 분리시켜 가는 방법
Dendrogram illustrating hierarchical clustering.
01
Observation number
02
03
04
05
06
07
08
1
2
3
4
5
6
7
11
[Single Linkage : 단일기준 결합 방식]
A
1.5
1.2
D
A
D
1.55
1.4
B
B
1.3
C
C
[Complete Linkage : 완전기준 결합방식]
A
A
1.5
1.55
D
D
B
C
B
C
12
[Average Linkage : 평균기준 결합방식]
A
A
1.45
D
D
1.425
B
B
C
C
13
[Ward Method]
●
●
●
●
●
●
●
●
●
●
●
●
[Centroid Method]
●
●
●
●
●
●
●
●
●
●
●
●
●
●
14
2) 비계층적 군집방법 (Nonhierarchical Clustering Procedures)
= k-means clustering
ⅰ) Sequential threshold procedure
① 하나의 cluster center를 선택하고 미리 산정된 거리 내에 있는
모든 대상을 그 cluster안에 포함시킨다.
② 두 번째 cluster center를 선택하고 미리 산정된 거리 내에 있는
모든 대상을 그 cluster안에 포함시킨다.
ⅱ) parallel threshold Procedure
① 초기에 여러 개의 cluster center를 선정하여 가장 가까운 center
로 대상을 포함시킨다
② threshold 거리는 조절될 수 있다
ⅲ) Optimizing Partitioning Method
: 전체적인 optimizing criterion (e.g.,within-cluster distance의
평균)에 따라 나중에 대상을 cluster별로 재편입 시킬 수 있다
15
▣ Nonhierarchical Clustering의 단점
① 사전에 cluster 수를 결정해야 한다
② Cluster Center 선정이 임의적이다
③ 결과가 data의 순서에 의존적이다
▣ Nonhierarchical Clustering의 장점
① center 선정에 있어서 nonrandorn
② Clustering 속도가 빠르다
16
3) 군집방법 선택 : Hierarchical Vs. Nonhierarchical
ⅰ) Hierarchical + Ward's Method + average linkage
⇒ 처음에 잘못 clustering되면 지속적으로 영향을 미친다
ⅱ) Hierarchical + Nonhierarchical
① Hierarchical procedure을 사용하여 최초 clustering 결과도출
(Ward Method + average linkage)
② 얻어진 cluster 숫자와 cluster centroid를 optimizing
partitioning method의 input으로 사용
17
(4) Cluster 숫자 결정
ⅰ) 이론적, 개념적, 실제적 목적 고려
ⅱ) cluster간의 거리로 판단
ⅲ) Nonhierarchical clustering에서
Within Group Variance
---------------------------- 을 도식화시켜
b/w Group Variance
꺾이는 부분을 찾아내어 cluster 숫자로 사용
ⅳ) cluster내에 case의 숫자로 판단
(one case를 가진 cluster는 바람직하지 않음)
18
(5) Cluster 해석
ⅰ) 보통 cluster centroid로 해석
ⅱ) Discriminant analysis 이용
(6) Validation
ⅰ) 여러 가지 distance measure를 사용한 결과 비교
ⅱ) 여러 가지 Algorithm을 사용한 결과 비교
ⅲ) data를 임의로 둘로 나누어 각각의 cluster centroids 비교
ⅳ) 일부 data를 임의로 빼고 나머지에 대한 결과를 비교
ⅴ) Nonhierarchical Clustering은 자료의 순서에 의존적이므로
자료의 순서를 바꾸어 여러번 clustering하고 가장 안정적인 결과선택
19
Examples
(1) Example 1
■ 목적 : 신형 자동차를 출시하기 위해서 기존 시장의 15차종에 대한
특성 파악
■ 자동차 분류기준 (사전조사결과) : 외형크기와 배기량
■ 외형 크기와 배기량은 표준화
표준화된 승용차 속성의 평가 점수
자 동 차 종류
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
외형적 크기
2.50
2.25
3.00
2.50
0.25
0.50
0.25
-0.25
-0.25
0.25
-2.00
-1.50
-2.50
-2.00
-2.50
엔진 배기량
2.50
2.00
2.00
1.75
1.00
0.50
0.25
0.50
-0.25
-0.50
-1.50
-1.75
-2.00
-2.25
-2.50
20
■ 승용차 특성을 2차원 도식화
X2 (엔진배기량)
[그림 18-4]
승용차 특성의 2차원 도표
A
B
D
C
E
H
G
F
X1 (외향적 크기)
I
J
K
L
M
N
O
21
■ SPSS의 Quick Cluster
→ Classification cluster center를 계산하여
각 cluster의 평균을 계산하여 다시 입력자료로 사용하는
방법
[그림 18-5]
단일결합방식
에 의한 결과
A
D
B
C
E
G
J
F
H
I
K
M
2
3
O
1
L
4
5
6
N
7
8
9
10
11
12
13
14
22
■ SPSS의 Quick Cluster
→ Classification cluster center를 계산하여
각 cluster의 평균을 계산하여 다시 입력자료로 사용하는
방법
[그림 18-6]
완전결합방식
에 의한 결과
A
D
B
C
E
G
J
F
H
I
N
M
2
3
5
K
O
1
L
4
6
6
7
9
11
10
12
13
14
23
(2) Example 2
■ 목적 : 회사 특성의 중요성 평가에 따른 고객 분류
(Stage 1) Partitioning
Step 1 : Hierarchical cluster Analysis
1) Similarity measure : Squared Euclidean distances
2) Algorithm : Ward's method
⇒ within-cluster difference를 최소화
3) cluster 수 결정
: Two cluster가 최선안으로 결정
24
TABLE 7.2 Analysis of Agglomeration
Coefficient for Hierarchical Cluster
Analysis
Number of]
Clusters
Percentage Change in
Agglomeration
Coefficient to Next Level
10
9
8
7
6
5
4
3
2
1
8.9
8.5
9.2
9.3
9.3
12.1
17.0
17.6
61.9
-
25
Step 2 : Nonhierarchical Cluster Analysis
→ hierarchical procedure 결과를 Fine-tune
⇒ Hierarchical procedure의 결과 확인
Results of Nonhierarchical Cluster Analysis with Initial Seed Points from Hierarchical Results
Mean Values*
Cluster
X1
X2
X3
X4
X5
X6
X7
1.39
3.22
8.70
6.74
5.09
5.69
2.94
2.87
2.65
2.87
5.91
8.10
1.58
3.21
8.90
6.80
4.92
5.60
2.96
2.87
2.52
2.82
5.90
8.13
Cluster Size
Classification cluster centers
1
2
4.40
2.43
Final cluster centers
1
2
4.38
2.57
52
48
26
Variables
Cluster M.S.
Df
Error M.S
df
F Ratio
Probability
Significance Testing of Differences Between Cluster Centers
X1
X2
X3
X4
X5
X6
X7
Delivery speed
Price level
Price flexibility
Manufacturer’s image
Overall service
Sales force’s image
Product quality
81.5631
66.4571
109.6372
11.3023
.1883
2.1233
123.3719
1
1
1
1
1
1
1
.9298
.7661
.8233
1.1778
.5682
.5786
1.2797
98.0
98.0
98.0
98.0
98.0
98.0
98.0
87.7172
86.7526
133.1750
9.5959
.3314
3.6697
96.4042
.000
.000
.000
.003
.566
.058
.000
* X1 = Delivery speed : X2 = Price level : X3 = Price flexibility : X4 = Manufacturer’s image :
X5 = Overall service : X6 = Sales force’s image : X7 = Product quality.
27
Group Means and Significance Level for Two-Group Nonhierarchical Cluster Solution
Cluster
Variables
1
2
F Ratio
Significance
4.460
1.576
8.900
4.926
2.992
2.510
5.904
2.570
3.152
6.888
5.570
2.840
2.820
8.038
105.00
76.61
111.30
8.73
1.02
4.17
82.68
.0000
.0000
.0000
.0039
.3141
.0438
.0000
42.32
4.38
21.312
26.545
.0000
.0000
Stage Two : Interpretation
X1
X2
X3
X4
X5
X6
X7
Delivery speed
Price level
Price flexibility
Manufacturer’s image
Overall service
Sales force’s image
Product quality
Stage Three : Profiling
Other variables of interest
X9 Usage level
X10 Satisfaction level
49.88
5.16
28
Stage Two : Interpretation
- Table 7.4 참조
- X5는 두 그룹 사이에 차이가 없는 것으로 평가됨
- Cluster 1 focuses ⅰ) delivery speed ⅱ) price flexibility
Cluster 2 focuses ⅰ) price ⅱ) manufacturer's image
ⅲ) sales force image ⅳ) product quality
Stage Three : Validation
- Table 7.5 참조 (결과의 consistency 확인)
⇒ 무작위로 선택한 subset으로 clustering하여 비교
29
TABLE 7.5 Results of Nonhierarchical Cluster Analysis with Randomly
Selected Initial Seed Points
Cluster
X1
X2
Classification cluster centers
1
4.95
1.14
2
1.76
2.70
Final cluster centers
1
4.47
1.57
2
2.63
3.10
X3
Mean Values*
X4
X5
X6
X7
Cluster Size
9.03
6.87
6.55
5.50
3.21
1.97
3.79
2.70
5.09
8.45
8.93
6.94
4.99
5.49
2.99
2.84
2.57
2.75
5.78
8.07
48
52
Significance Testing of Differences Between Cluster Centers
Variables
X1
X2
X3
X4
X5
X6
X7
Cluster M.S.
Delivery speed
Price level
Price flexibility
Manufacturer’s image
Overall service
Sales force’s image
Product quality
84.3339
58.6837
98.5164
6.2640
.5883
.7477
131.1200
Df
Error M.S
1
1
1
1
1
1
1
.9016
.8454
.9367
1.2292
.5641
.5927
1.2007
df
98.0
98.0
98.0
98.0
98.0
98.0
98.0
F Value
93.5415
69.4175
105.1700
5.0958
1.0428
1.2616
109.2055
Probability
.000
.000
.000
.026
.310
.264
.000
* X1 = Delivery speed : X2 = Price level : X3 = Price flexibility : X4 = Manufacturer’s image :
X5 = Overall service : X6 = Sales force’s image : X7 = Product quality.
30