KMedoids {TSdist} | R 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 |
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: |
... |
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")