View source: R/clustering_design.R
cluster.error | R Documentation |
This function computes the clustering error.
cluster.error(design, X = NULL, alpha = 1)
design |
a design matrix. |
X |
candidate points in |
alpha |
power of the Euclidean distance. |
cluster.error
computes the clustering error. The clustering error for a design D=[\bm x_1, \dots, \bm x_n]^T
is defined as \frac{1}{N}\sum_{i=1}^n\sum_{\bm x\in{V_i}}\|\bm x - \bm x_i\|^\alpha
, where V_i
is the Voronoi cell of each design point \bm x_i
for i=1,\dots,n
, N is the size of X. When \alpha=2
, we obtain K-means and when \alpha=1
, we obtain K-medians.
clustering error of the design.
n = 20
p = 3
D = randomLHD(n, p)
cluster.error(D)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.