Wrapper for calculating centroids averageSP or medoids medoidSP when clustering, with efficient optimization when iterating kdba clustering calculations
clusterSPcenters(
SPx,
clustering,
config,
centers = "centroids",
clustering_old = NULL,
cents = NULL,
distmat = NULL
)
a named sarp.snowprofile::snowprofileSet of centroid/medoids profiles for each cluster where the name refers to the corresponding cluster and is sorted in ascending manner.
a sarp.snowprofile::snowprofileSet to be clustered
vector of integers (from 1:k) indicating the cluster to which each snow profile is allocated
a list providing the necessary hyperparameters for distance and average calculations. Use clusterSPconfig functions for convenience!
type of center to determine, either centroids
(default) where an average profile is computed for each cluster
or medoids
where the index of the medoid profile is identified
same as clustering
but from the previous iteration of a kdba (if provided then this function only computes new centroids when the profiles within a cluster changed)
a sarp.snowprofile::snowprofileSet of centroids from the previous iteration; provide NULL
if not available
a precomputed distance matrix of class dist (for faster medoid calculations)
fherla shorton
clusterSPkdba, dbaSP