Kmedians {Kmedians} | R Documentation |
Kmedians
Description
K-medians algorithms.
Usage
Kmedians(X,nclust=1:15,ninit=0,niter=20,
method='Offline', init=TRUE,par=TRUE)
Arguments
X |
A numerical matrix giving the data. |
nclust |
A vector of positive integers giving the possible numbers of clusters. Default is |
ninit |
A non negative integer giving the number of random initializations. Default is |
niter |
A positive integer giving the number of iterations for the EM algorirthms. Default is |
method |
The selected method for the K-medians algorithm. Can be |
init |
A logical argument telling if the function |
par |
A logical argument telling if the parallelization of the algorithm is allowed. Default is |
Value
A list with:
bestresults |
A list giving all the results for the clustering selected by |
allresults |
A list containing all the results. |
SE |
A vector giving the Sum of Errors for each considered number of clusters. |
cap |
The results given by the function |
Ksel |
An integer giving the number of clusters selected by |
data |
A numerical matrix giving the data. |
nclust |
A vector of positive integers giving the considered numbers of clusters. |
For the lists bestresult
and allresults
:
cluster |
A vector of positive integers giving the clustering. |
centers |
A numerical matrix giving the centers of the clusteres. |
SE |
An integer giving the Sum of Errors. |
References
Godichon-Baggioni, A. and Surendran, S. A penalized criterion for selecting the number of clusters for K-medians. arxiv.org/abs/2209.03597
See Also
See also Kmeans
, Kplot
and gen_K
.
Examples
## Not run:
n <- 500
K <- 3
pcont <- 0.2
ech <- gen_K(n=n,K=K,pcont=pcont)
X <-ech$X
res <- Kmedians(X,par=FALSE)
Kplot(res)
## End(Not run)