clucenters | R Documentation |
Determine cluster centers using the uniform distribution, taking into account
the number of clusters (num_clusters
) and the average cluster separation
(clu_sep
).
More specifically, let \mjseqnc=num_clusters
,
\mjeqn\mathbfs=s=clu_sep
, \mjeqn\mathbfo=o=clu_offset
,
\mjseqnn=length(clu_sep)
(i.e., number of dimensions). Cluster centers
are obtained according to the following equation:
C=c\mathbfU\cdot\operatornamediag(\mathbfs) + \mathbf1\,\mathbfo^TC=cU.diag(s) + 1o'
where \mjeqn\mathbfCC is the \mjeqnc \times nc x n matrix of cluster centers, \mjeqn\mathbfUU is an \mjeqnc \times nc x n matrix of random values drawn from the uniform distribution between -0.5 and 0.5, and \mjeqn\mathbf11 is an \mjeqnc \times 1c x 1 vector with all entries equal to 1.
clucenters(num_clusters, clu_sep, clu_offset)
num_clusters |
Number of clusters. |
clu_sep |
Average cluster separation (\mjeqnn \times 1n x 1 vector). |
clu_offset |
Cluster offsets (\mjeqnn \times 1n x 1 vector). |
A \mjeqnc \times nc x n matrix containing the cluster centers.
This function is stochastic. For reproducibility set a PRNG seed with set.seed.
set.seed(321)
clucenters(3, c(30, 10), c(-50,50))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.