a = c(2, 1, 0, 2, 0, 1, 1, 1)
b <- c(2, 1, 1, 1, 1, 0, 1, 1)
test_that("cosine similarity test", {
expect_equal(0.1784162, as.numeric(cosine_dist(rbind(a,b))), tolerance = 1e-6)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.