You are on page 1of 10

Iter

Customer Money spent Money


on dresses spent on
Age(X) (₹1000) (Y) Cluster Center Age dresses
1 28 11 2 1 10.0 8.0
2 45 2 2 2 43.0 6.0
3 28 15 2
4 51 3 2 SSE 1656.4
5 42 7 2
6 26 12 1
7 23 10 1

8 43 3.2 2
9 26 17 1
10 45 2.6 2
11 24 10 1

Iter

Customer Money spent Money


on dresses spent on
Age(X) (₹1000) (Y) Cluster Center Age dresses
1 28 11 1 1 24.8 12.3
2 45 2 2 2 40.3 6.3
3 28 15 1
4 51 3 2 SSE 291.3
5 42 7 2
6 26 12 1
7 23 10 1
8 43 3.2 2
9 26 17 1
10 45 2.6 2
11 24 10 1

Iter
B

Customer Money spent Money


on dresses spent on
Age(X) (₹1000) (Y) Cluster Center Age dresses
1 28 11 1 1 25.8 12.5
2 45 2 2 2 45.2 3.6
3 28 15 1
4 51 3 2 SSE 126.8
5 42 7 2
6 26 12 1
7 23 10 1
8 43 3.2 2
9 26 17 1
10 45 2.6 2
11 24 10 1

Iter
B

Customer Money spent Money


on dresses spent on
Age(X) (₹1000) (Y) Cluster Center Age dresses
1 28 11 1 1 25.8 12.5
2 45 2 2 2 45.2 3.6
3 28 15 1
4 51 3 2 SSE 126.8
5 42 7 2
6 26 12 1
7 23 10 1
8 43 3.2 2
9 26 17 1
10 45 2.6 2
11 24 10 1
k-means Clustering
Iteration 1

18

16

X14 Y X Y Min Squared Distance


#N/A #N/A 28 11 250.0
12
#N/A #N/A 45 2 20.0
10 #N/A #N/A 28 15 306.0
#N/A #N/A 51 3 73.0
8
#N/A #N/A 42 7 2.0
6 26 12 #N/A #N/A 272.0
23 10 #N/A #N/A 173.0
4

2
#N/A #N/A 43 3.2 7.8
0 26 17 #N/A #N/A 337.0
5 10 15
#N/A #N/A20 25
45 30 35
2.6 40 45 50 55
15.6
24 10Cluster 1#N/A
Cluster 2 #N/A
Center 200.0

Iteration 2

18

16

X14 Y X Y Min Squared Distance


12 28 11 #N/A #N/A 12.1
#N/A #N/A 45 2 40.3
10
28 15 #N/A #N/A 18.1
8 #N/A #N/A 51 3 125.4
6 #N/A #N/A 42 7 3.5
26 12 #N/A #N/A 1.6
4
23 10 #N/A #N/A 8.1
2 #N/A #N/A 43 3.2 16.7
0 26 17 #N/A #N/A 24.1
20
#N/A 25 30
#N/A 35
45 40
2.6 45 50 55
35.6
24 10Cluster 1#N/ACluster 2 #N/A
Center 5.6

Iteration 3

18

16

X14 Y X Y Min Squared Distance


12

10

8
18

16

14

12 28 11 #N/A #N/A 6.9


#N/A #N/A 45 2 2.5
10
28 15 #N/A #N/A 10.9
8 #N/A #N/A 51 3 34.0
6 #N/A #N/A 42 7 22.1
26 12 #N/A #N/A 0.3
4
23 10 #N/A #N/A 14.3
2 #N/A #N/A 43 3.2 5.0
0 26 17 #N/A #N/A 20.3
20
#N/A 25 30
#N/A 35
45 40
2.6 45 50 55
1.0
24 10Cluster 1#N/ACluster 2 #N/A
center 9.6

Iteration 4

18

16

X14 Y X Y Min Squared Distance


12 28 11 #N/A #N/A 6.9
#N/A #N/A 45 2 2.5
10
28 15 #N/A #N/A 10.9
8 #N/A #N/A 51 3 34.0
6 #N/A #N/A 42 7 22.1
26 12 #N/A #N/A 0.3
4
23 10 #N/A #N/A 14.3
2 #N/A #N/A 43 3.2 5.0
0 26 17 #N/A #N/A 20.3
20
#N/A 25 30
#N/A 35
45 40
2.6 45 50 55
1.0
24 10Cluster 1#N/ACluster 2 #N/A
center 9.6
1. Input the distances of each point from both the cluster centres in all the ce
2. For Dist_C1,Input the distance formula for each datapoint to cluster center
3. For Dist_C2,Input the distance formula for each datapoint to cluster center
4. The new centers of the clusters will appear in the next iteration box
Dist_C1 Dist_C2 5. Repeat this process till the centers of 2 consecutive iterations converge
18.2 15.8 6. If the all the inputs are correctly filled, then you will find that the cluster ce
This means that the solution converged and the final segmentation is done.
35.5 4.5
19.3 17.5
41.3 8.5
32.0 1.4
16.5 18.0
13.2 20.4

33.3 2.8
18.4 20.2
35.4 3.9
14.1 19.4

Dist_C1 Dist_C2
3.5 13.2
22.7 6.4
4.3 15.1
27.8 11.2
18.0 1.9
1.3 15.4
2.9 17.7
20.4 4.1
4.9 17.9
22.4 6.0
2.4 16.7

Dist_C1 Dist_C2
2.6 18.7
21.9 1.6
3.3 20.7
26.9 5.8
17.1 4.7
0.5 21.0
3.8 23.1
19.5 2.2
4.5 23.4
21.6 1.0
3.1 22.2

Dist_C1 Dist_C2
2.6 18.7
21.9 1.6
3.3 20.7
26.9 5.8
17.1 4.7
0.5 21.0
3.8 23.1
19.5 2.2
4.5 23.4
21.6 1.0
3.1 22.2
th the cluster centres in all the cells of Dist_C1 and Dist_C2 columns
r each datapoint to cluster center 1 (Refer formula in the cell T6)
r each datapoint to cluster center 2 (Refer formula in the cell U6)
ar in the next iteration box
nsecutive iterations converge
en you will find that the cluster centers in Iteration 3 and 4 will be same.
the final segmentation is done.
Distance Distance
Customer Money to Cluster to Cluster
spent on centre 1 centre 2 Assigned
Age dresses Cluster

1 28 11 18.2 15.8 2
2 45 2 35.5 4.5 2
3 28 15 19.3 17.5 2
4 51 3 41.3 8.5 2
5 42 7 32.0 1.4 2
6 26 12 16.5 18.0 1
7 23 10 13.2 20.4 1

8 43 3.2 33.3 2.8 2

9 26 17 18.4 20.2 1
10 45 2.6 35.4 3.9 2
11 24 10 14.1 19.4 1
Money
Cluster spent on
Center Age dresses
1 10.0 8.0
2 43.0 6.0

Customer

Age

Money
Customer spent on
dresses Assigned
Age (₹1000) Cluster 6 26
1 28 11 2 7 23
2 45 2 2 9 26
3 28 15 2 11 24

4 51 3 2 Age
Cluster centre
5 42 7 2 1 25.8
8 43 3.2 2
10 45 2.6 2

Money
spent on
dresses
Age (₹1000)
Cluster
centre 2 45.2 3.6
Money
spent on
dresses Assigned
(₹1000) Cluster

12 1
10 1
17 1
10 1

Money
spent on
dresses
(₹1000)

12.5

You might also like