KMedoids: K medoids clustering for a time series database using the...

View source: R/K-medoids.R

KMedoidsR Documentation

K medoids clustering for a time series database using the selected distance measure.

Description

Given a specific distance measure and a time series database, this function provides the K-medoids clustering result. Furthermore, if the ground truth clustering is provided, and the associated F-value is also provided.

Usage

KMedoids(data,  k, ground.truth, distance, ...)

Arguments

data

Time series database saved in a numeric matrix, a list, an mts object, a zoo object or xts object.

k

Integer value which represents the number of clusters.

ground.truth

Numerical vector which indicates the ground truth clustering of the database.

distance

Distance measure to be used. It must be one of: "euclidean", "manhattan", "minkowski", "infnorm", "ccor", "sts", "dtw", "keogh_lb", "edr", "erp", "lcss", "fourier", "tquest", "dissimfull", "dissimapprox", "acf", "pacf", "ar.lpc.ceps", "ar.mah", "ar.mah.statistic", "ar.mah.pvalue", "ar.pic", "cdm", "cid", "cor", "cort", "wav", "int.per", "per", "mindist.sax", "ncd", "pred", "spec.glk", "spec.isd", "spec.llr", "pdc", "frechet")

...

Additional parameters required by the chosen distance measure.

Details

This function is useful to evaluate the performance of different distance measures in the task of clustering time series.

Value

clustering

Numerical vector providing the clustering result for the database.

F

F-value corresponding to the clustering result.

Author(s)

Usue Mori, Alexander Mendiburu, Jose A. Lozano.

See Also

To calculate the distance matrices of time series databases the TSDatabaseDistances is used.

Examples


# The example.database3 synthetic database is loaded
data(example.database3)
tsdata <- example.database3[[1]]
groundt <- example.database3[[2]]

# Apply K-medoids clusterning for different distance measures

KMedoids(data=tsdata, ground.truth=groundt, k=5, "euclidean")
KMedoids(data=tsdata, ground.truth=groundt, k=5, "cid")
KMedoids(data=tsdata, ground.truth=groundt, k=5, "pdc")



TSdist documentation built on Aug. 31, 2022, 5:09 p.m.