kMeansMap | R Documentation |
May give better results than 'RandomMap' on data where random sampling
is complicated.
This does not use actual kMeans clustering, but re-uses the batch version of
SOM()
with tiny radius (which makes it work the same as kMeans). In
consequence, the speedup of SOM function is applied here as well. Additionally,
because we don't need that amount of clustering precision, parameters ‘batch=F, rlen=1’
may give a satisfactory result very quickly.
kMeansMap(data, k, coordsFn, batch = T, ...)
data |
Input data matrix, with individual data points in rows |
k |
How many points to sample |
coordsFn |
a function to generate embedding coordinates (default none) |
batch |
Use batch-SOM training (effectively kMeans, default TRUE) |
... |
Passed to |
map object (without the grid, if coordsFn was not specified)
d <- iris[,1:4] EmbedSOM::PlotEmbed( EmbedSOM::EmbedSOM( data = d, map = EmbedSOM::kMeansMap(d, 10, EmbedSOM::GraphCoords())), pch=19, clust=iris[,5] )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.