Description Usage Arguments Value Examples
This function does a weighted K-means clustering.
1 2 3 4 5 | ComputeMeans(cm, data, weight, nclust)
AssignCluster(data, weight, M, nclust)
KMeansW(nclust, start, data, weight, eps = 1e-08, IterMax = 100L)
|
cm |
Numeric vector of class indicators. |
data |
The concatenated data, with N rows and M columns. Currently, the columns are clustered. |
weight |
The vector of length |
nclust |
The number of clusters. |
M |
Matrix of cluster means. |
start |
The current cluster membership vector. |
eps |
Numerical absolute convergence criteria for the K-means. |
IterMax |
Integer giving the maximum number of iterations allowed for the K-means. |
A list with the folowing values.
centers |
the |
cluster |
vector of length N with cluster memberships. |
loss |
vector of length |
iterations |
the number of iterations used (corresponding to the number
of nonzero entries in |
1 2 3 4 5 6 7 8 | set.seed(1)
clustmem <- sample.int(n = 10, size = 100, replace = TRUE)
mat <- rbind(matrix(rnorm(30*4, mean = 3), nrow = 30),
matrix(rnorm(30*4, mean = -2), nrow = 30),
matrix(rnorm(40*4, mean = 0), nrow = 40))
wt <- runif(100)
testMeans <- lsbclust:::ComputeMeans(cm = clustmem, data = mat, weight = wt, nclust = 3)
testK <- lsbclust:::KMeansW(start = clustmem, data = mat, weight = wt, nclust = 3)
|
Loading required package: parallel
Loading required package: ggplot2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.