View source: R/mc2pca_clustering.R
mc2pca_clustering | R Documentation |
mc2pca_clustering
performs the clustering algorithm proposed by
\insertCiteli2019multivariate;textualmlmts, which is based on common principal component analysis (CPCA).
mc2pca_clustering(X, k, var_rate = 0.9, max_it = 1000, tol = 1e-05)
X |
A list of MTS (numerical matrices). |
k |
The number of clusters. |
var_rate |
Rate of retained variability concerning the reconstructed MTS samples (default is 0.90). |
max_it |
The maximum number of iterations (default is 1000). |
tol |
The tolerance (default is 1e-5). |
This function executes the crisp clustering method proposed by
. The algorithm is a K
-means-type procedure where the distance
between a given MTS and a centroid is given by the reconstruction error
taking place when the series is reconstructed from the common space obtained
by considering all the series in the cluster associated with the corresponding
centroid (the common space is the centroid).
A list with two elements:
cluster
. A vector defining the clustering solution.
iterations
. The number of iterations before the algorithm
stopped.
Ángel López-Oriona, José A. Vilar
li2019multivariatemlmts
clustering_algorithm <- mc2pca_clustering(BasicMotions$data, k = 4, var_rate = 0.30)
# Executing the clustering algorithm in the dataset BasicMotions (var_rate = 0.30,
# i.e., we keep only a few principal components for computing the reconstructed series)
clustering_algorithm$cluster # The clustering solution
clustering_algorithm$iterations # The number of iterations before the algorithm
library(ClusterR)
external_validation(clustering_algorithm$cluster, BasicMotions$classes,
summary_stats = TRUE) # Evaluating the clustering algorithms vs the true partition
# stopped
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.