ls_clust {lazy.cluster} | R Documentation |
This function uses stats::kmeans to perform
Least Squares cluster analysis under homoschedastic multivariate
normal model.
The main purpose of this function is to be used from "dhclust" function.
ls_clust(df, ncl = 2, maxiter = 100, nstart = 1, init_method = "ward.D2", algorithm = "Hartigan-Wong", print = 1)
df |
obs x variable data frame |
ncl |
# of clusters to be sought |
maxiter |
max # of iterations |
nstart |
= 0 to use hclust solution as the initial |
init_method |
method for hclust |
algorithm |
parameter for kmeans |
print |
= 1 or 2 to print some result |
Since native kmeans does not work when nrow(df) == ncl,
including the case where nrow(df) == 2, some modifications were made
to the final result.
A class "kemans" object which has
betweenss, totss, tot.withinss
are added.
resml <- ml_clust( circle2, 5, print=2 )