These functions support hierarchical agglomerative clustering in sits. They provide support from creating a dendrogram and using it for cleaning samples.
link[sits]{sits_cluster_dendro()} takes a tibble with time series and produces a sits tibble with an added "cluster" column. The function first calculates a dendrogram and obtains a validity index for best clustering using the adjusted Rand Index. After cutting the dendrogram using the chosen validity index, it assigns a cluster to each sample.
link[sits]{sits_cluster_frequency()} computes the contingency table between labels and clusters and produces a matrix. Its input is a tibble produced by link[sits]{sits_cluster_dendro()}.
link[sits]{sits_cluster_clean()} takes a tibble with time series that has an additional cluster produced by link[sits]{sits_cluster_dendro()}
and removes labels that are minority in each cluster.
samples: Tibble with input set of time series (class "sits").
bands: Bands to be used in the clustering (character vector)
dist_method: One of the supported distances (single char vector) "dtw": DTW with a Sakoe-Chiba constraint. "dtw2": DTW with L2 norm and Sakoe-Chiba constraint. "dtw_basic": A faster DTW with less functionality. "lbk": Keogh's lower bound for DTW. "lbi": Lemire's lower bound for DTW.
linkage: Agglomeration method to be used (single char vector) One of "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median" or "centroid".
k: Desired number of clusters (overrides default value)
palette: Color palette as per grDevices::hcl.pals() function.
...: Additional parameters to be passed to dtwclust::tsclust() function.
Returns
Tibble with "cluster" column (class "sits_cluster").