Nothing
test_that("Test that KMedoids function works properly", {
# We create a database with two series, each one replicated 5 times:
x <- cumsum(rnorm(50))
y <- sin(seq(0, pi, length.out=50))
data <- rbind(x, x, x, x, x, y, y, y, y, y)
classes <- c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2)
clustering <- KMedoids(data, k=2, classes, "euclidean")
#Such easy database is always clustered perfectly F=1.
expect_equal(clustering$F, 1)
#If we don't define a ground truth, we only get the clustering value
clustering <- as.numeric(KMedoids(data, k=2, "euclidean"))
expect_equal(clustering, classes)
# LCSS is not a distance measure, but a similarity, so a different treatment
# is necessary
clustering <- as.numeric(KMedoids(data, k=2, "lcss", epsilon=1))
expect_equal(clustering, classes)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.