Skip to content

K Means Clustering

The easiest way to use this is by using the =GetKMeansCluster() formula in a table.
Points
x
y
z
Cluster
Cluster from generated
22
22
16
StatKit icon
d
StatKit icon
d
11
4
18
StatKit icon
e
StatKit icon
c
10
9
19
StatKit icon
e
StatKit icon
c
2
25
23
StatKit icon
c
StatKit icon
a
12
10
20
StatKit icon
b
StatKit icon
c
20
19
4
StatKit icon
e
StatKit icon
e
24
4
2
StatKit icon
d
StatKit icon
b
17
6
11
StatKit icon
e
StatKit icon
b
3
12
9
StatKit icon
d
StatKit icon
e
18
25
10
StatKit icon
c
StatKit icon
d
There are no rows in this table
For something that will probably calculate quicker, you can use =GenerateAllClusters() and then add those in order with a column formula like =Clusters.Nth(Points.Find(thisRow))
d
c
c
a
c
e
b
b
e
d
Note that the name of the clusters will differ based on randomness even with the same inputs, but the centroids should be about the same.
I also wrapped clustering of 1 to provide a centroid formula. The centroid of the points above is: (
13.913.613.2
)

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.