dkmeans(X, centers, iter.max = 10, nstart = 1, sampling_threshold = 1e+06, trace = FALSE, na_action = c("exclude","fail"), completeModel = FALSE)
completeModel=TRUE
'nstart' will be discarded.
The algorithm of Lloyd-Forgy (Lloyd 1957 and Forgy 1965) is used at the current version. If an initial matrix of centres is supplied, it is possible that no point will be closest to one or more centres, which currently generates a warning message.
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.
kmeans
## Not run:
# library(kmeans.ddR)
#
# iris2 <- iris[,-5]
# centers <- matrix(c(5.901613,5.006000,6.850000,2.748387,3.428000,
# 3.073684,4.393548,1.462000,5.742105,1.433871,0.246000,2.071053),3,4)
# dimnames(centers) <- list(1L:3L, colnames(iris2))
#
# X <- as.darray(data.matrix(iris2))
#
# (mykm1 <- dkmeans(X,centers=centers))
#
# (mykm2 <- dkmeans(X,centers=3, completeModel=TRUE))
# ## End(Not run)
Run the code above in your browser using DataLab