KMedoids | R Documentation |
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.
KMedoids(data, k, ground.truth, distance, ...)
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. |
This function is useful to evaluate the performance of different distance measures in the task of clustering time series.
clustering |
Numerical vector providing the clustering result for the database. |
F |
F-value corresponding to the clustering result. |
Usue Mori, Alexander Mendiburu, Jose A. Lozano.
To calculate the distance matrices of time series databases the TSDatabaseDistances
is used.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.