EHyClus | R Documentation |
It creates a multivariate dataset containing the epigraph, hypograph and/or its modified versions on the curves and derivatives and then perform hierarchical clustering, kmeans, kernel kmeans, and spectral clustering
EHyClus(
curves,
vars_combinations,
k = 30,
n_clusters = 2,
bs = "cr",
clustering_methods = c("hierarch", "kmeans", "kkmeans", "spc"),
l_method_hierarch = c("single", "complete", "average", "centroid", "ward.D2"),
l_dist_hierarch = c("euclidean", "manhattan"),
l_dist_kmeans = c("euclidean", "mahalanobis"),
l_kernel = c("rbfdot", "polydot"),
grid,
true_labels = NULL,
only_best = FALSE,
verbose = FALSE,
n_cores = 1
)
curves |
Dataset containing the curves to apply a clustering algorithm.
The functional dataset can be one dimensional ( |
vars_combinations |
If |
k |
Number of basis functions for the B-splines. If equals to |
n_clusters |
Number of clusters to generate. |
bs |
A two letter character string indicating the (penalized) smoothing
basis to use. See |
clustering_methods |
character vector specifying at least one of the following clustering methods to be computed: "hierarch", "kmeans", "kkmeans" or "spc". |
l_method_hierarch |
|
l_dist_hierarch |
|
l_dist_kmeans |
|
l_kernel |
|
grid |
Atomic vector of type numeric with two elements: the lower limit and the upper limit of the evaluation grid. If not provided, it will be selected automatically. |
true_labels |
Numeric vector of true labels for validation. If provided, evaluation metrics are computed in the final result. |
only_best |
|
verbose |
If |
n_cores |
Number of cores to do parallel computation. 1 by default, which mean no parallel execution. Must be an integer number greater than 1. |
A list
containing the clustering partition for each method and indices
combination and, if true_labels
is provided a data frame containing the time elapsed for obtaining a
clustering partition of the indices dataset for each methodology. Also, the number of
generated clusters and the combinations of variables used can be seen as attributes
of this object.
# univarariate data without labels
curves <- sim_model_ex1(n = 10)
vars_combinations <- list(c("dtaEI", "dtaMEI"), c("dtaHI", "dtaMHI"))
EHyClus(curves, vars_combinations = vars_combinations)
# multivariate data with labels
curves <- sim_model_ex2(n = 5)
true_labels <- c(rep(1, 5), rep(2, 5))
vars_combinations <- list(c("dtaMEI", "ddtaMEI"), c("dtaMEI", "d2dtaMEI"))
res <- EHyClus(curves, vars_combinations = vars_combinations, true_labels = true_labels)
res$cluster # clustering results
# multivariate data and generic (default) vars_combinations
curves <- sim_model_ex2(n = 5)
EHyClus(curves)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.