Description Usage Arguments Value References See Also Examples
kMeansLloyd
performs the k-means algorithm based on
Lloyd's paper (1982) on a data matrix.
1 | kMeansLloyd(x, centroids, maxIter = 10L, nStart = 1L)
|
x |
matrix or an object that can be coerced to a matrix
(e.g. data.frame): contains the observations that are clustered. Note:
|
centroids |
integer (numeric) or matrix: If an integer, a random set of
(distinct) rows in |
maxIter |
integer (numeric): is the maximum number of iterations that is allowed. |
nStart |
integer (numeric): if |
kMeansLloyd
returns an object of class kMeans
. Methods
implemented for class kMeans
include: print
, summary
,
plot
and fitted
.
An object of class kMeans
is a list containing the following
components:
|
a vector of integers indicating the cluster allocation of each point. |
|
a matrix of cluster centroids. |
|
the number of iterations. |
|
the number of points in each cluster. |
|
the data matrix. |
|
a vector of within-cluster sum of squares (one component per cluster). |
|
total within-cluster sum of squares (i.e.
|
Lloyd, S. P. (1957, 1982). Least squares quantization in PCM. Technical Note, Bell Laboratories. Published in 1982 in IEEE Transactions on Information Theory, 28, 128-137.
print.kMeans
, summary.kMeans
,
plot.kMeans
, fitted.kMeans
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.